IBM Books

Application Development Guide


Returning Result Sets from Stored Procedures

You can code stored procedures to return one or more result sets to DB2 CLI, ODBC, JDBC, or SQLJ client applications. Aspects of this support include:

For additional details on handling multiple result sets:

The following diagram shows typical use of this facility:

(1)
A client application program AP calls a procedure SP providing two input arguments.

(2)
SP determines, based on those arguments, that three result sets are to be returned.

(3)
SP provides open cursors on the statements that define the result sets.

(4)
AP processes the result sets in a general loop that is able to deal with different numbers and different types of results.


Returning multiple result sets from a stored procedure


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]