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
 
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 Handling result sets in the calling N... Rusikesh DB2 7 Fri Apr 13, 2018 12:25 am
No new posts CICS web service from DB2 Triggers or... kiranprasad DB2 2 Wed Dec 20, 2017 11:10 am
No new posts Weirdo results with JOINKEYS Balaryan DFSORT/ICETOOL 4 Wed Oct 18, 2017 9:04 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm

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