SYS_refcursor in pl/sql block

  • From: "Harvinder Singh" <Harvinder.Singh@xxxxxxxxxxxxx>
  • To: "ORACLE-L" <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 25 Aug 2006 13:37:20 -0400

Hi,

We are using SYS_REFCURSOR in our procedures as out put parameter to
return the result of a query, is there any equivalent I can use in
pl/sql block without a procedure. Here is what we are trying to do:
Begin
Insert into table....;
Select a from table inner join b.....;
End;

Since Oracle don't allow select without into clause in pl/sql, I added a
variable of syscursor but now I am not getting error but not getting the
result set also:
Declare 
A sys_refcursor;
Begin
Insert into table....;
Open a for Select a from table inner join b.....;
End;

Is there any option that we can use without converting this to
procedure?

Thanks
--Harvinder

--
//www.freelists.org/webpage/oracle-l


Other related posts: