Help on returning a collection as Ref cursor
Hello Everyone.
I have a table
create table test1
(
col1 number,
col2 number
)
and the values are
insert into test1 values (1,1);
insert into test1 values (2,2);
insert into test1 values (3,3);
insert into test1 values (4,4);
I have to write a new function to do the following.
1. It will delete all record where col1 >2
2. send the table of record back as refe cusor to the calling program.
I know the below code is wrong but I would like to know how to do it?
create or replace function test ( aa_rec out SYS_REFCURSOR)
is
type aa is table of test1%ROWTYPE;
aa_rec aa;
I have a table
create table test1
(
col1 number,
col2 number
)
and the values are
insert into test1 values (1,1);
insert into test1 values (2,2);
insert into test1 values (3,3);
insert into test1 values (4,4);
I have to write a new function to do the following.
1. It will delete all record where col1 >2
2. send the table of record back as refe cusor to the calling program.
I know the below code is wrong but I would like to know how to do it?
create or replace function test ( aa_rec out SYS_REFCURSOR)
is
type aa is table of test1%ROWTYPE;
aa_rec aa;
0