(Contents)(Previous)(Next)

Calling a DB Procedure

A DB procedure is called by the SQL statement DBPROCEDURE (in SQL-PL by the alternative statement CALL DBPROC or CALL PROC).

The statement CALL DBPROC is exclusively used for calling a DB procedure already stored in the database. If the DB procedure does not yet exist in the database (state: 'RUN', not '->DB') or if the specified parameters are not compatible with the formal parameters of the DB procedure, an error is output for the CALL DBPROC statement when storing.

Generally a DB procedure is tested first as if it was a normal SQL-PL routine. After concluding the test and storing the DB procedure in the database the developer is not forced to change CALL PROC calls occurring in possible modules to CALL DBPROC calls. In such a case the system performs the CALL DBPROC call implicitly.

If the DB procedure has been called with the option WITH COMMIT, the current database transaction is terminated if the call of the DB procedure is successful.

In DB procedures, further DB procedures are called with the statement CALL PROC.

See also

Setting the Error Number

Difference from CALL PROC


(Contents)(Previous)(Next)