DB2 Version 10.1 for Linux, UNIX, and Windows

Calling procedures in embedded SQL applications

You can call procedures from embedded SQL applications by formulating and executing the CALL statement with an appropriate procedure reference and parameters. You can issue the CALL statement either statically or dynamically within embedded SQL applications.

However, for each programming language there are different methods to issue this command. No matter which host language, each host variable used in the procedure must be declared to match the data type which is required.

Client applications and the calling of routines exchange information with procedures through parameters and result sets. The parameters for procedures are defined by the direction the data is traveling (the parameter mode).

There are three types of parameters for procedures: The mode of parameters and their data types are defined when a procedure is registered with the CREATE PROCEDURE statement.