MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Stored Procedure to access multiple instances of database

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Tue Jul 06, 2004 8:10 am    Post subject: Stored Procedure to access multiple instances of database Reply with quote

Hi All,
I have a 'odd' requirement to retrieve data from multiple instances of a table thru a Stored Procedure returning multiple
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Jul 06, 2004 8:46 am    Post subject: Reply with quote

Sureshkumar,

The cursor will be live as long as you don't execuete the GOBACK command in the stored procedure. YOu can retrieve the result set from the 5 cursors as long as they don't exceed the 32k limit.

Code:

PROCEDURE DIVISION USING SP1-IN-PARM     
                         SP1-CURSOR1-OUTPUT1     
                         SP1-CURSOR2-OUTPUT2     
                         SP1-CURSOR3-OUTPUT3     
                         SP1-CURSOR4-OUTPUT4
                         SP1-CURSOR5-OUTPUT5.


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Tue Jul 06, 2004 8:52 am    Post subject: Reply with quote

Thanks Kolusu, but the SP is not the one that will do the fetch, the SP will issue a goback or the control is returned to the client and that application on the Distributed box is the one doing all the fetch's. thanks
Back to top
View user's profile Send private message
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Tue Jul 06, 2004 12:44 pm    Post subject: Reply with quote

Ok, I tested it. The Cursor is live for both instances of the cursor after return to the client.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group