Hi,
Does anyone know how to create a procedure that calls another procedure with a cursor and then uses that cursor in a loop?
procedure SP_ASSIGN_HOUSING
AS
myHousingRankingCursor HOUSINGTYPES.HOUSING_CURSOR;
BEGIN
/* call SP with cursor */
SP_GET_HOUSING_LIST(myHousingRankingCursor);
/* use cursor in loop
-- the next line causes an error that my cursor isn't
-- defined, even though it's defined above.
*/
FOR ranking_rec IN myHousingRankingCursor
LOOP
IF ranking_rec.Ranking=4 then
INSERT INTO
topoflist
VALUES(sq_topoflistuid.nextval, ranking_rec.employeeuid, 3);
EXIT LOOP;
END IF;
END LOOP;
END;
Does anyone know how to create a procedure that calls another procedure with a cursor and then uses that cursor in a loop?
procedure SP_ASSIGN_HOUSING
AS
myHousingRankingCursor HOUSINGTYPES.HOUSING_CURSOR;
BEGIN
/* call SP with cursor */
SP_GET_HOUSING_LIST(myHousingRankingCursor);
/* use cursor in loop
-- the next line causes an error that my cursor isn't
-- defined, even though it's defined above.
*/
FOR ranking_rec IN myHousingRankingCursor
LOOP
IF ranking_rec.Ranking=4 then
INSERT INTO
topoflist
VALUES(sq_topoflistuid.nextval, ranking_rec.employeeuid, 3);
EXIT LOOP;
END IF;
END LOOP;
END;