Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 154

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
References
ashimer

Senior Member


Joined: 13 Feb 2004
Posts: 360
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

Senior Member


Joined: 13 Feb 2004
Posts: 360
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: 154

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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1