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 > How do I use Result set returned from SP to calling program?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-06-09, 15:10
DB2Hero DB2Hero is offline
Registered User
 
Join Date: Nov 2007
Posts: 4
How do I use Result set returned from SP to calling program?

Hi.

I am new to programming with DB2. I need to return a result set to the calling program but I do not know how to declare the locators to point to the
result set returned by the SP. I declared the cursor as WITH RETURN.

I have been reading the SQL reference book but it does not have an example to initialize the locators. It jiust said to DESCRIBE the SP the associate the LOCATORS. The example shows:

ASSOCIATE RESULT SET LOCATORS (:RS1) WITH PROCEDURE proc_name

What goes into the host variable RS1?

Any help will be much appreciated. thanks!
Reply With Quote
  #2 (permalink)  
Old 04-06-09, 16:09
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Reply With Quote
  #3 (permalink)  
Old 04-06-09, 17:52
DB2Hero DB2Hero is offline
Registered User
 
Join Date: Nov 2007
Posts: 4
Thank you!
Reply With Quote
  #4 (permalink)  
Old 04-09-09, 23:36
DB2Hero DB2Hero is offline
Registered User
 
Join Date: Nov 2007
Posts: 4
this does not seem to work in DB2 for Z/os. I'm using COBOL as host language. Is there an equivalent statement for DB2 for Z ?
Thanks.
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