PL/SQL (MOSC)

MOSC Banner

Help on returning a collection as Ref cursor

edited Feb 27, 2013 2:59AM in PL/SQL (MOSC) 3 commentsAnswered
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;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center