Posted: Mon Jan 06, 2003 3:30 pm Post subject: Multiple records as input to a DB2 Stored procedure
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.
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
Posted: Tue Jan 07, 2003 12:06 am Post subject:
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.
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