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 > Opening Cursors

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-04-09, 04:24
sushma007 sushma007 is offline
Registered User
 
Join Date: Aug 2007
Posts: 64
Thumbs down Opening Cursors

Dear Friends ,

I am creating one DB2 procedure which contains 3 cursors . Now at the end of procedure i am opening all these cursors one by one.

OPEN CURSOR1;
OPEN CURSOR2;
OPEN CURSOR3;

When i execute this procedure i expect the resultset from the last cursor in the opened list(CURSOR3), but I am getting the resultset from the first opened cursor alone . Please suggest me whether all the cursors have opened in this case or only the first cursor has opened
Reply With Quote
  #2 (permalink)  
Old 03-04-09, 05:04
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
have you defined the cursors with return - created proc with x resultsets...
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 03-04-09, 07:39
sushma007 sushma007 is offline
Registered User
 
Join Date: Aug 2007
Posts: 64
Yes i defined procedure for 3 resultsets

DYNAMIC RESULT SETS 3
Reply With Quote
  #4 (permalink)  
Old 03-04-09, 08:04
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
The question was how exactly you declared the cursors. Do you use the WITH RETURN TO CALLER or WITH RETURN TO CLIENT clause for all 3 of them?

Could you reduce the SP code to still exhibit the problem and then post it here?
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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