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 

Multiple records as input to a DB2 Stored procedure

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


Joined: 06 Jan 2003
Posts: 20
Topics: 7
Location: Columbus, OH

PostPosted: Mon Jan 06, 2003 3:30 pm    Post subject: Multiple records as input to a DB2 Stored procedure Reply with quote

Hi,
This question has been posted by my friend in different MVS website. Thought I would also post it here. Basically we would like to know what are all the ways one can pass the input to a Stored Procedure from client server environment?
Thanks,
Pradeep

Here is the actual question posted by my friend.

As per the requirements I have at hand, multiple records have to be passed to a DB2 stored procedure (coded in COBOL). As of now I have one solution to this i.e. by having all the records stringed together and to have the string passed as a VARCHAR field to the stored procedure. I am presently hunting for a solution where the records can be passed to the stored procedure as something similar to an array or a record-set. The difference being that here the record-set will be sent TO the stored procedure rather than being returned FROM the stored procedure.

Do any of you have any pointers in this regard? If so please oblige to reply.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Tue Jan 07, 2003 12:06 am    Post subject: Reply with quote

Hi,

I don't understand why you are stringing together all the variables into a single VARCHAR variable and then passing it to the stored procedure. You can keep it as separate variables and then pass all the variables without stringing them into a single one. Just make sure that the PARMLIST in SYSIBM.SYSROUTINES (SYSIBM.SYSPROCEDURES in v5) refelcts the number of variables that you are expecting in the stored procedure.
Now, if you need to pass a recordset(By recordset, I mean a number of records having the same layout), consider declaring a table for that and inserting the records in the table before calling the stored procedure. The stored procedure can then read the same table and process the records.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
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