Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Can Pass Input parameter as CURSOR to DB2 Stored Procedure?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Can Pass Input parameter as CURSOR to DB2 Stored Procedure?
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us