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: Ref cursor

RE: Ref cursor

From: Justin Cave \(DDBC\) <jcave_at_ddbcinc.com>
Date: Sat, 23 Dec 2006 02:17:53 -0700
Message-ID: <FF249C724A53714DBE741B2AAF8CA34677DF4C@EXCHANGE.ddbc.local>


You could use a pipelined table function. For example  

create or replace type tbl_number as table of number;  

create or replace function numbers_between( low in number, high in number )

  return tbl_number

  pipelined

is

begin

  for i in low..high

  loop

    pipe row( i );

  end loop;

end;  

The query  

select *

  from table( numbers_between( 1, 15 ));  

will then return the numbers 1 through 15 as separate rows in a result.  

Justin  


From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Ken Naim Sent: Saturday, December 23, 2006 4:02 AM To: 'Oracle Discussion List'
Subject: Ref cursor  

I have a reporting application that cannot handle procedures/functions very well and I require a query which has to be built dynamically so I was wondering if there was a way to select from function that returns a ref cursor as if it were a table or a view?    

Thanks,

Ken  

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Dec 23 2006 - 03:17:53 CST

Original text of this message

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