If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > nested stored procedures returning result sets in db2 v8 for Z/OS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-23-07, 04:39
sheela562 sheela562 is offline
Registered User
 
Join Date: Apr 2007
Posts: 10
nested stored procedures returning result sets in db2 v8 for Z/OS

How to return the result sets from one procedure to the another in case of nested stored procedures in db2 v8 for Z/OS
Reply With Quote
  #2 (permalink)  
Old 07-23-07, 07:30
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
When you declare a cursor for a result set, you can specify WITHOUT RETURN (which is the default), or WITH RETURN TO CALLER. The latter will ensure that the cursor is not closed at the end of the procedure implicitly. The calling procedure can then use the ASSOCIATE RESULT SET LOCATOR statement to get a handle on the result set returned by the called procedure.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 07-24-07, 02:23
sheela562 sheela562 is offline
Registered User
 
Join Date: Apr 2007
Posts: 10
Thanks for the quick response.I have one more question.
As per my knowledge on SQLDA(SQL Descriptor area), it can be used to get the details of number of columns,column names and their data type,length in a result set by using describe cursor statement.Could you throw some light on SQL Descriptor area?Will this be of any use in solving the nested procedures issue?
Reply With Quote
  #4 (permalink)  
Old 07-24-07, 05:10
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
SQLDA is relevant to host languages only. If your calling procedure is written in SQL, you don't have an SQLCA. Also, result sets from SPs can only be accessed from applications using JDBC or CLI and not embedded SQL.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #5 (permalink)  
Old 07-24-07, 07:01
sheela562 sheela562 is offline
Registered User
 
Join Date: Apr 2007
Posts: 10
Thanks for the reply.
Thanks in advance for my next question.
How to proceed with when the number result sets returned by called procedure is not known in the calling procedure?Is there anything like describe procedure or describe cursor.
Reply With Quote
  #6 (permalink)  
Old 07-24-07, 07:12
sheela562 sheela562 is offline
Registered User
 
Join Date: Apr 2007
Posts: 10
How can we create the required number of RESULT SET LOCATOR's when the number of result sets returned by called procedure is not known ?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On