Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Is there any way refer to the results of a stored procedure
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Vision results (also known as DYL-280) CaptBill CA Products 1 Tue Dec 20, 2016 3:35 am
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us