ODBC Stored Procedures

Team-Fly    

 
DB2 Universal Database for OS/390 v7.1 Application Certification Guide
By Susan Lawson
Table of Contents
Chapter 11.  ODBC/CLI Programming

ODBC Stored Procedures

Although embedded SQL stored procedures provide the most advantages, application developers who have existing DB2 ODBC applications might wish to move components of the application to run on the server. In order to minimize the required changes to the code and logic of the application, these components can be implemented by writing stored procedures using DB2 ODBC. Autocommit must be turned off and a null connection should be used.

The MVSATTACHTYPE keyword should be set to RRSAF if the stored procedure contains any LOB data types or distinct types in its parameter list. DB2 for OS/390 and z/OS requires that stored procedures containing any LOBs or distinct types must run in a WLM-established stored procedure address space.

Programming Stored Procedures to Return Result Sets

In a stored procedure, DB2 ODBC uses cursors declared WITH RETURN. Cursors that are closed before the stored procedure exit are local cursors. Cursors that remain open return result sets. In order for a DB2 ODBC stored procedure to return a result set, it must not close the cursor and it must not free the statement handle, the connection handle, or the environment handle.


Team-Fly    
Top


DB2 Universal Database for OS. 390 v7. 1 Application Certification Guide
DB2(R) Universal Database for OS/390 V7.1 Application Certification Guide (IBM DB2 Certification Guide Series)
ISBN: 0131007718
EAN: 2147483647
Year: 2002
Pages: 163
Authors: Susan Lawson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net