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
- Do your processing here..
END LOOP;
END LOOP;
END
"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