Re: Problem with passing data from one cursor to another.

From: Martyn Rankin <mgf_rankin_at_yahoo.com>
Date: 22 May 2003 09:03:10 -0700
Message-ID: <c4147d77.0305220803.23bab1b4_at_posting.google.com>


>
> If I understand correctly from your post... you want to take a value
> from one cursor and pass it to a second cursor which can then be used
> in the where clause of the second cursor???. You can do that e.g.
>
> DECLARE
> CURSOR parent_ IS
> SELECT dept_id FROM department;
> --
> CURSOR child_ (dept_id_ IN VARCHAR2) IS
> SELECT emp_id FROM employees WHERE dept_id = dept_id_;
> BEGIN
> FOR rec_parent_ IN parent_ LOOP
> FOR rec_child_ IN child_ (rec_parent_.dept_id) LOOP
> ....
> END LOOP;
> END LOOP;
> END;
> /
>
> Regards
> /Rauf Sarwar

Thanks Rauf, your help enabled me to do exactly what I wanted to do.

Cheers

Martyn Received on Thu May 22 2003 - 18:03:10 CEST

Original text of this message