create or replace procedure refcur1(refcur_out out sys_refcursor)
is
begin
open refcur_out for q'#select 'A' alphabet from dual
union all
select 'B' from dual
union all
select 'C' from dual
#';
end;
Procedure created.
create or replace procedure refcur2(refcur_out out sys_refcursor)
is
begin
open refcur_out for q'#select 'A' alphabet from dual
union all
select 'B' from dual
union all
select 'C' from dual
#';
end;
Procedure created.
create or replace type rc_tt is table of varchar2(1)
Type created.
create or replace function tf1 return rc_tt
is
l sys_refcursor;
l_returnvalue rc_tt;
begin
refcur1(l);
fetch l bulk collect into l_returnvalue;
RETURN l_returnvalue;
end;
Function created.
select * from table(tf1)
COLUMN_VALUE | A | B | C |
---|
create or replace function tf2 return rc_tt
is
l sys_refcursor;
l_returnvalue rc_tt;
begin
refcur2(l);
fetch l bulk collect into l_returnvalue;
RETURN l_returnvalue;
end;
Function created.
select * from table(tf2)
COLUMN_VALUE | A | B | C |
---|
select * from table(tf1)
minus
select * from table(tf2)
no data found