create or replace package david3 as TYPE r_type IS OBJECT ( code VARCHAR2 (3), description VARCHAR2 (30) ); TYPE tr_type IS TABLE OF r_type; type myref is ref cursor; function foo return myref; end david3; create or replace package body david3 as function foo return myref as myreturn myref; l_rarray tr_type; l_rec r_type; BEGIN l_rec.code := 'R1'; l_rec.description := 'R1 Description'; l_rarray := tr_type( l_rec ); FOR i IN l_rarray.FIRST .. l_rarray.LAST LOOP dbms_output.put_line( i ); DBMS_OUTPUT.put_line (l_rarray(i).code || ' - ' ||l_rarray(i).description); END LOOP; open myreturn for select * from l_rarray; return myreturn; END foo; end david3;