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

Is there any way refer to the results of a stored procedure


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

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Tue Jul 22, 2008 9:13 pm
Reply with quote

Is there any way we can refer to the results of a stored procedure and use it as a table in a single sql query. In other words can we incorporate a stored procedure in a sql query and based on the results of the Stored procedure filter out some rows?
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Jul 22, 2008 9:27 pm
Reply with quote

Nope
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Jul 22, 2008 9:32 pm
Reply with quote

You can do this to an extend by calling a stored procedure from within a UDF or user defined function ... by a little tweaking ...

Code:


• Main query calls function.

• Function calls stored-procedure.

• Stored-procedure retrives the data

• Stored procedure returns result back to the function

• Function returns the result back to the main query.



But here make sure that the result set is only 1 ... Try it out
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Wed Jul 23, 2008 2:45 am
Reply with quote

Thanks a lot, I kind of figured this out. I was looking for one without using a User function. Thanks though.
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 DB2 Statistics - Using EXPLAIN and qu... DB2 1
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
Search our Forums:

Back to Top