I have a package that returns a ref cursor. For example:

create or replace package test as

type gencursor is ref cursor;

procedure mytest(
x out gencursor);

end test;

create or replace package body test as

procedure mytest(
x out gencursor) as

rc gencursor;


open rc for
select a,b,c,d from test_tables;

end mytest;

end test;

Then in SQLPlus I have

x test.gencursor;
for v1 in x loop
dbms_output.put_line(x.a||' '||x.b||' '||x.c||' '||x.d);
end loop;

for v1 in x loop
ERROR at line 5:
ORA-06550: line 5, column 11:
PLS-00221: 'X' is not a procedure or is undefined
ORA-06550: line 5, column 1:
PL/SQL: Statement ignored

How do I iterate through the cursor that is being passed back from my procedure???

Thanks for your help.