7.5.2 CALL

Table of Contents Previous Next



7.5.2 CALL
Use the CALL statement to invoke a procedure or function on the server. The CALL statement works only on Advanced Server. The CALL statement comes in two forms; the first form is used to call a function:
EXEC SQL CALL program_name '('[actual_arguments]')'
INTO [[:
ret_variable][:ret_indicator]];
EXEC SQL CALL program_name '('[actual_arguments]')';
program_name is the name of the stored procedure or function that the CALL statement invokes. The program name may be schema-qualified or package-qualified (or both); if you do not specify the schema or package in which the program resides, ECPGPlus will use the value of search_path to locate the program.
actual_arguments specifies a comma-separated list of arguments required by the program. Note that each actual_argument corresponds to a formal argument expected by the program. Each formal argument may be an IN parameter, an OUT parameter, or an INOUT parameter.
:ret_variable specifies a host variable that will receive the value returned if the program is a function.
:ret_indicator specifies a host variable that will receive the indicator value returned, if the program is a function.
For example, the following statement invokes the get_job_desc function with the value contained in the :ename host variable, and captures the value returned by that function in the :job host variable:


Table of Contents Previous Next