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:
- IN parameters: data passed to the procedure.
- OUT parameters: data returned by the procedure.
- INOUT parameters: data passed to the procedure that is, during
procedure execution, replaced by data to be returned from the procedure.
The mode of parameters and their data types are defined when
a procedure is registered with the CREATE PROCEDURE statement.