CALL statement

The CALL statement (call_statement) causes a database procedure to be executed.

Syntax

<call_statement> ::= CALL <dbproc_name> [(<expression>,...)] [WITH COMMIT]

Examples

SQL Tutorial, Database Procedures

Explanation

The specified database procedure name must identify an existing database procedure.

The current user must have the EXECUTE privilege for the database procedure.

The number of expressions (expression) must be equal to the number of formal parameters for the database procedure.

The data type of the ith expression must be compatible with the data type of the ith formal parameter for the database procedure.

If the ith formal parameter for the database procedure has the OUT or INOUT mode (see CREATE DBPROC statement), the corresponding expression must be a parameter specification.

WITH COMMIT

If WITH COMMIT is specified, the current transactions are terminated with COMMIT after the database procedure has been executed correctly. If execution of the database procedure fails, the current transaction is terminated with ROLLBACK.