Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > DB2 > 3 level Cobol Nested Stored procedure problems.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-17-02, 12:47
pushramesh pushramesh is offline
Registered User
 
Join Date: Jan 2002
Posts: 4
3 level Cobol Nested Stored procedure problems.

Hi,

I have a client program (Java) calling SP1 calls SP2 calls SP3. SP1, SP2, SP3 are Cobol stored procedures all defined with NO COMMIT ON RETURN.
SP1 calls SP2 successfully, then SP2 calls SP3 successfully. Then SP3 returns values to SP2 successfully. SP3 passes values to SP2 successfully.
In SP2 there is a join of tables and the resultant set is put in a cursor. I am opening the cursor in SP2. Till this point all the calls are successful.
Now the cursor opened on SP2 will be fetched from SP1.
The first step in SP1 is ASSOCIATE LOCATOR to the SP2. ..this is successful. Next step is ALLOCATE the cursor which is opened in SP2 to the LOCATOR...this is also successful.
Then I am trying to fetch the cursor in SP1 which is already opened from SP2. At that time I am getting -501 (trying to fetch a cursor which is not open).
I am checking the sqlcode after the open cursor in SP2 and it is successful.
But when I try to fetch the same cursor from SP1, its returning back -501.
Can anyone help me out ?
Thanks much in advance.
Reply With Quote
  #2 (permalink)  
Old 01-22-02, 08:41
msujit msujit is offline
Registered User
 
Join Date: Jan 2002
Location: India
Posts: 3
Try WITH HOLD and WITH RETURN

Have you used CURSOR WITH HOLD and WITH RETURN ?
Reply With Quote
  #3 (permalink)  
Old 01-22-02, 12:22
pushramesh pushramesh is offline
Registered User
 
Join Date: Jan 2002
Posts: 4
Cool

WITH RETURN AND WITH HOLD CANNN'T BE USED IN THE SAME DECLARED CLAUSE.
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

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