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

Home -> Community -> Usenet -> c.d.o.misc -> Re: pl/sql cursor question

Re: pl/sql cursor question

From: Janaka <janakaxyz_at_yahoo.com>
Date: 9 Dec 2003 04:11:34 -0800
Message-ID: <125f2cec.0312090411.29aa14cc@posting.google.com>


Well you can try something like this..

DECLARE
   CURSOR inner_c IS
     SELECT * FROM TEMP;
   CURSOR outter_c(in_someValue some_other_table.some_column%type) IS

     SELECT * FROM some_other_table
     WHERE some_column = in_someValue;

BEGIN      FOR inner_r IN inner_C LOOP
    FOR outter_r IN outter_c(inner_r.some_column) LOOP

"Derek" <d.rogers_at_its.uq.edu.au> wrote in message news:<br3u62$ftr$1_at_bunyip.cc.uq.edu.au>...
> Any PL/SQL guru's out there know if you can use an cursor result set as a
> table within another SQL statement?
> I want to do something like this:
>
>
> DECLARE
> TYPE dyn_cursor IS REF CURSOR;
> inner_curs dyn_cursor;
> outer_curs dyn_curosr;
> BEGIN
> OPEN inner_c FOR 'SELECT a FROM temp'; -- a couple of records returned
> OPEN outer_c FOR 'SELECT some_column FROM some_other_table WHERE
> some_column IN (SELECT 1 FROM inner_curs)';
> ...
> END;
>
>
>
> Thanks,
> Derek.
Received on Tue Dec 09 2003 - 06:11:34 CST

Original text of this message

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