Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: SYS_refcursor in pl/sql block

Re: SYS_refcursor in pl/sql block

From: Mindaugas Navickas <mnavickas_at_yahoo.com>
Date: Fri, 25 Aug 2006 15:16:16 -0400 (EDT)
Message-ID: <20060825191616.41368.qmail@web30108.mail.mud.yahoo.com>


This works... but I do not see point of doing that since you are not returning your cursor to any code/variable:

declare
  a sys_refcursor;
Begin
-- Insert into table....;
  open a for
    select table_name from cat;
end;
/

Regards
Mindaugas
--- Harvinder Singh <Harvinder.Singh_at_MetraTech.com> wrote:

> 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
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>



Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Aug 25 2006 - 14:16:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US