How can I separate cursor spec. from body? [message #37657] |
Tue, 19 February 2002 06:37 |
marco
Messages: 46 Registered: March 2001
|
Member |
|
|
hi,
I'd like to separate a cursor specification from its body but I get PLS-00488, at compilation time, where I reference the cursor variable with P1.C1 in P2. How should one code this?
Thanks,
Marco
----------------------------------------------
CREATE OR REPLACE PACKAGE P1 AS
CURSOR c1 RETURN students%ROWTYPE;
END P1;
/
CREATE OR REPLACE PACKAGE BODY P1 AS
CURSOR c1 RETURN students%ROWTYPE IS
select * FROM students WHERE Major = 'Music';
END P1;
/
---------------------------------------------
CREATE OR REPLACE PROCEDURE P2 IS
c_curstud P1.C1; <------ PLS-00488 Compile error
BEGIN
FOR v_cs IN c_curstud LOOP
...
END LOOP;
CLOSE c_curstud;
END P2;
/
|
|
|
|