IBM Books

Call Level Interface Guide and Reference

Stored Procedure Call Syntax

The ODBC escape clause for calling a stored procedure is:

 {[?=]call procedure-name[([parameter][,[parameter]]...)]}

A procedure may have zero or more parameters. (The square brackets ([ ]) indicate optional arguments.)

ODBC species the optional parameter ?= to represent the procedure's return value, which, if present, will be stored in the location specified by the first parameter marker as defined via SQLBindParameter(). DB2 CLI will return the SQLCODE as the procedure's return value if ?= is present in the escape clause. If ?= is not present, then the application can retrieve the SQLCA by using the SQLGetSQLCA() function. Unlike ODBC, DB2 CLI does not support literals as procedure arguments, parameter markers must be used.

For more information about stored procedures, refer to "Using Stored Procedures" or the Embedded SQL Programming Guide.

For example, DB2 CLI will translate the following statement:

    {CALL NETB94(?,?,?)}

To an internal CALL statement format:

 
    CALL NEBT94(?, ?, ?)


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]