CALL

Calls a procedure.

call.png

 

Usage

Embedded, Interactive, Module, ODBC, Procedural, JDBC.

Description

The CALL statement is used to invoke a procedure. As there can be multiple procedures with the same name, the number of parameters and their type is used to determine which actual procedure should be invoked.

The nature of each expression depends on the parameter it applies to. For parameters with mode OUT or INOUT, expression must be a target-variable, see Target Variables. For parameters with mode IN, expression may be a value-expression.

The value of expression must be assignment-compatible with the data type of the parameter to which it is applied, see Assignments.

Restrictions

In programming environments a cursor is needed when invoking result set procedures, see ALLOCATE CURSOR and DECLARE CURSOR for information about calling result set procedures.

In interactive SQL, the CALL statement is used to invoke all types of procedures.

Recursion is permitted, an error will be raised if the internal recursion limit is exceeded.

In a procedural usage context, the called procedure must have an access-clause which is lower or equal to that of the calling procedure, see CREATE PROCEDURE for details about procedure access clause values.

Notes

The CALL statement is not used to invoke functions.

Examples

CALL PROC1();

 

CALL PROC2(X,Y);

 

CALL IDENT1.PROC7(CURRENT_DATE, X+3, Z);

Standard Compliance

Standard

Compliance

Comments

SQL-2016

Core

Fully compliant.