Collection Contents Index BEGIN TRANSACTION statement CASE statement pdf/chap9.pdf

Reference Manual
   CHAPTER 9. SQL Statements     

CALL statement


Function 

To invoke a procedure.

Syntax 

[variable = ] CALL procedure-name ( [ expression ,... ] )

[variable = ] CALL procedure-name ( [ parameter-name = expression ,... ] )

Permissions 

Must be the owner of the procedure, have EXECUTE permission for the procedure, or have DBA authority.

Side effects 

None.

See also 

CREATE PROCEDURE statement

GRANT statement

EXECUTE statement

Using Procedures, Triggers, and Batches

Description 

The CALL statement invokes a procedure that has been previously created with a CREATE PROCEDURE statement. When the procedure completes, any INOUT or OUT parameter values will be copied back.

The argument list can be specified by position or by using keyword format. By position, the arguments will match up with the corresponding parameter in the parameter list for the procedure. By keyword, the arguments are matched up with the named parameters.

All arguments are optional: procedure arguments can be assigned default values in the CREATE PROCEDURE statement, and missing parameters are assigned the default value or, if no default is set, NULL.

Inside a procedure, a CALL statement can be used in a DECLARE statement when the procedure returns result sets (see Returning results from procedures).

Procedures can return a value (as a status indicator, say) using the RETURN statement. You can save this return value in a variable using the equality sign as an assignment operator:

CREATE VARIABLE returnval INT ;
returnval = CALL proc_integer ( arg1 = val1, ... )

Standards and compatibility 

Examples 


Collection Contents Index BEGIN TRANSACTION statement CASE statement pdf/chap9.pdf