The CALL statement invokes a procedure. The syntax of CALL in an SQL function, SQL procedure, or SQL trigger is a subset of what is supported as a CALL statement in other contexts.
See CALL for details.
>>-+--------+--CALL--procedure-name--argument-list------------->< '-label:-' argument-list |--(--+--------------------+--)---------------------------------| | .-,--------------. | | V | | '---+-expression-+-+-' '-NULL-------'
Each parameter defined (using CREATE PROCEDURE) as OUT or INOUT must be specified as either a SQL-variable-name or a SQL-parameter-name.
The number of arguments specified must be the same as the number of parameters of a procedure defined at the current server with the specified procedure-name.
The application requester assumes all parameters that are variables are INOUT parameters. All parameters that are not variables are assumed to be input parameters. The actual attributes of the parameters are determined by the current server.
expression
An expression of
the type described in Expressions, that
does not include an aggregate function or column name. If extended
indicator variables are enabled, the extended indicator variable values
of DEFAULT and UNASSIGNED must not be used for that expression.
Rules for arguments to OUT and INOUT parameters: Each OUT or INOUT parameter must be specified as an SQL parameter or SQL variable.
Special registers: The initial value of a special register in a procedure is inherited from the caller of the procedure. A value assigned to a special register within the procedure is used for the entire SQL procedure and will be inherited by any procedure subsequently called from that procedure. When a procedure returns to its caller, the special registers are restored to the original values of the caller.
Related information: See CALL for more information.
Call procedure proc1 and pass SQL variables as parameters.
CALL proc1(v_empno, v_salary)