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

How to write a stored procedure that returns multiple rows


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

New User


Joined: 19 Apr 2006
Posts: 1
Location: mumbai

PostPosted: Wed Dec 10, 2008 10:58 pm
Reply with quote

Can you please help me how to write a stored procedures that returns multiple rows as a result.

and I need to write the result to a file as well.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Thu Dec 11, 2008 1:38 pm
Reply with quote

If you know how to write a stored procedure for 1 result set, you'll be able to write it for multiple result sets as well. You need to have as many
Code:
OPEN cursor CURSOR WITH RETURN
as the number of result sets. Your routine should specify the resultset parameter >= no. of result set you expect from the Stored proc.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top