I am getting the error - PLS-00382 Expression is of wrong type.
I want to get the ref cursor as output. please let me know how can I do this
create or replace function test_cur
return sys_refcursor
as
var_ref sys_refcursor;
begin
open var_ref for
select item,status
from item_master
where rownum <10;
return var_ref;
end;
declare
l_var sys_refcursor;
l_item varchar2(100);
l_status varchar2(10);
begin
l_var:=test_cur;
open l_var;
loop
fetch l_var into l_item,l_status;
exit when l_var%notfound;
dbms_output.put_line(l_item||','||l_status);
end loop;
end;
Can anybody please help me resolving this issue?