Invoking multiple instances of a stored procedure
Your application program can issue multiple CALL statements to the same local or remote stored procedure. Assume that your stored procedure returns result sets and the calling application leaves those result sets open before the next call to that same stored procedure. In that case, each CALL statement invokes a unique instance of the stored procedure.
About this task
When you invoke multiple instances of a stored procedure, each instance runs serially within the same Db2 thread and opens its own result sets. These multiple calls invoke multiple instances of any packages that are invoked while running the stored procedure. These instances are invoked at either the same or different level of nesting under one Db2 connection or thread.
For local stored procedures that issue remote SQL, instances of the applications are created at the remote server site. These instances are created regardless of whether result sets exist or are left open between calls.
If you call too many instances of a stored procedure or if you open too many cursors, Db2 storage shortages and EDM POOL FULL conditions might occur. If the stored procedure issues remote SQL statements to another Db2 server, these conditions can occur at both the Db2 client and at the Db2 server.
Procedure
To invoke multiple instances of a stored procedure: