Cursor Value used in another Cursor SELECT

From: David Burke <dtburke_at_software.rockwell.com>
Date: 4 Jun 2002 07:15:51 -0700
Message-ID: <87685036.0206040615.2e6b6971_at_posting.google.com>


I need to select data using one cursor that depends on a value retrieved from another cursor. I am not sure how to do this in Oracle. Can somebody please shed some light on this for me? Here is some code snippet of what I would like to accomplish:

nId int;
nResId int;

cursor myCursor is select lId from FDMSeg where lId is not null; cursor myCursor2 is select lResId from FDMRes where lResId = nId;

BEGIN
open myCursor;
fetch myCursor into nId;
open myCursor2;
fetch myCursor2 into nResId;
close myCursor;
close myCursor2;
END



There is a lot more to it than this, this is a general idea of what I need to do. I have not gotten this to work. I can do this in SQLServer (i am an amateur at pl/sql). Any help is appreciated. Thanks Received on Tue Jun 04 2002 - 16:15:51 CEST

Original text of this message