Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: NEED FUNCTION to accept parameter, return "query-able" recordset

Re: NEED FUNCTION to accept parameter, return "query-able" recordset

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 01 May 2002 15:41:48 GMT
Message-ID: <3CD00CBA.FD7203E@exesolutions.com>


contrapositive wrote:

> Yes, there is documentation on the web that talks about dynamic PL/SQL, ref
> cursors, etc. -- and indeed one or some combination of these might be what I
> need -- but I'm having trouble finding some concrete examples. I really
> don't want to do anything that awful complicated...
>
> I would like a function (or something) that could accept one or two
> parameters and return a "temporary" recordset that I could in turn query
> (join to, outer join to, etc.). Pseudocode follows...
>
> CREATE OR REPLACE make_temp_table(id INT) ... AS ...
> obj := select * from orders where customer_id = id;
> return obj;
> END;
>
> [Inside a package...]
> SELECT *
> FROM make_temp_table(12) x,
> some_other_table y,
> yet_another z
> WHERE x.whatever = y.whatever
> AND x.whatever_else = z.whatever_else(+)
>
> Yes, I've desecrated the language here, but hopefully it's sufficient enough
> to explain my needs. Is it possible to do this or something close? What are
> my options? Where can I see some good samples or find some good instruction?
> We're using Oracle 8i.
>
> Thanks, as always, in advance...
>
> -jk

You want to do something complex but not 'awfully' complex?

Sorry but I can't help you.

Returning a recordset is returning a recordset. It is what it is.

It is only complex until you've done it a dozen times or so.

Daniel Morgan Received on Wed May 01 2002 - 10:41:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US