Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using procedure with multiple out variables in a query

PleiadianAug 28 2012 — edited Aug 29 2012
Hi,

We have a procedure that is time-consuming, which returns 4 variables as out parameters:
procedure calc_values(id in number, val1 out number, val2 out number, val3 out number, val4 out number) is
The id uniquely identifies an product in our database.

I would like to use this in a query (or view), in the form
select s.id, val1, val2, val3, val4 from something s, product_table p
where s.id = p.id
I have tried the following approach, but I am kinda stuck

* define a type
* define a table of this type
* write a wrapper function that calls this procedure and returns the results as a table
* pivot the table into columns
* join this with the product table

It feels like I am on the wrong track, i am having trouble to get the id from the product table back into the wrapper function.

Is there a better approach to this? I am on oracle 10g

Thanks!

Rob
This post has been answered by Matthew Morris on Aug 28 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 26 2012
Added on Aug 28 2012
5 comments
152 views