Ref cursor variable declaration
Hi, Here is my package where I want to read the RefCursor returned by another PL/SQL Package :
create or replace package read_refcursor AS
type generic_ref_cur is ref cursor;
type r is record(
FIRST_DATE DATE,
LAST_DATE DATE,
TOTAL_STUDENTS INTEGER);
END read_refcursor;
create or replace package body read_refcursor AS
r1 r;
outrefcursor generic_ref_cur;
BEGIN
reporting.quiz_score_report('M125Xassess-1::AS', null, 13087, null, outrefcursor);
LOOP
fetch outrefcursor into r1;
exit when outrefcursor%notfound;
dbms_output.put_line(r1.FIRST_DATE);
END LOOP;
END read_refcursor;
I get the error 'PLS-00994: Cursor Variables cannot be declared as part of a package' on the line 'outrefcursor generic_ref_cur;'.
Procedure reporting.quiz_score_report expects a RefCursor as an OUT parameter.
What is the right way to do this ? Thanks.
Shiva.