IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can Pass Input parameter as CURSOR to DB2 Stored Procedure?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vvgoud

New User


Joined: 16 Aug 2007
Posts: 27
Location: Hyderabad

PostPosted: Fri May 22, 2009 7:37 pm
Reply with quote

Hello,

Whether DB2 support one of the Input parameter as Cursor in Stored procedures. How to handle the Multiple rows as input to stored procedures, these rows count is different in each execution.


My Requirement: On Client system opened one cursor and retrieve some rows from based on some conditions. This information should pass to mainframe.

For example DEFECT table has below two columns

DEFCT_LINE_NUM_I CHAR(3)
DEFCT_X CHAR(80)

Client system should pass above information to Mainframe.

Please confirm Below method is correct?

In My DDL I have declared maximum limit is 20 and handling the situation , is this correct way?


)
IN IN_DEFCT_LINE_NUM_I CHAR (60), // 3 * 20 = 60
IN IN_DEFCT_X CHAR (1600), // 80 * 20 = 1600
OUT OUT_ERROR_MSG CHAR (254),
OUT OUT_ERROR_CODE CHAR (10)
)
RESULT SETS 0

Disadvantages:

Client system cannot pass more than 20 Rows at a time
Client system should concatenate all the DEFCT_LINE_NUM_I into one string and pass as input parameter and same for DEFCT_X also.
He has to pass the fixed length ( while concatenating he has to use the fixed length )


Please somebody help on this.

Thanks,
VVGOUD.
Back to top
View user's profile Send private message
a027412

New User


Joined: 05 Jul 2007
Posts: 40
Location: Minneapolis, MN

PostPosted: Tue Jun 02, 2009 9:19 pm
Reply with quote

VVGoud,
Your approach is correct. I have a similar scenario in my project and this is how we do. The inputs should be concatenated into on string and the receiving mainframe store proc should unstring the inputs and process individually.
Let me know if you are struck some where.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts force tablespace using LISTDEF input DB2 1
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
Search our Forums:

Back to Top