SQL Language Guide : 7. Database Procedures, Sessions, and Events : How Database Procedures Are Created, Invoked, and Executed : Methods of Executing Procedures
 
Share this page                  
Methods of Executing Procedures
Database procedures can be executed in the following ways:
By using the EXECUTE PROCEDURE statement in an embedded SQL application.
This statement executes a specified procedure and passes parameter values to the procedure. To specify different parameter lists at runtime, use the dynamic version of the EXECUTE PROCEDURE statement. To execute a procedure owned by a user other than the effective user of the session, specify the procedure name using the schema.procedure_name syntax.
From interactive SQL, from within another database procedure, or by using the dynamic SQL EXECUTE IMMEDIATE statement.
Note:  These methods cannot execute row-producing procedures.
A procedure cannot be executed using the dynamic SQL PREPARE and EXECUTE statements.
By using the OpenAPI IIapi_query() function.
For details about executing a database procedure, see EXECUTE PROCEDURE in the chapter “SQL Statements.”
All referenced objects must exist at the time the procedure is executed. Between the time of creation and the time of execution, objects such as tables and columns can be modified, reordered, or dropped and recreated without affecting the procedure definition. However, if an object is redefined in a way that invalidates the procedure definition, drop and recreate the procedure.