DB2 Version 10.1 for Linux, UNIX, and Windows

Call to a stored procedure with anonymous block

C and C++ embedded SQL applications can call a stored procedure with use of the anonymous block when the PRECOMPILE option COMPATIBILITY_MODE is set to ORA.

The following example calls a stored procedure, INOUT_PARAM, with use of the anonymous block:
EXEC SQL EXECUTE BEGIN INOUT_PARAM(:inout_median:medianind,
   :out_sqlcode:codeind, :out_buffer:bufferind); END; END-EXEC;
The inout_median, out_sqlcode, and out_buffer are host variables and medianind, codeind, and bufferind are null indicator variables.
Remember: The embedded SQL applications do not support returning the values from a stored procedure.