Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Ref cursor
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-lReceived on Sat Dec 23 2006 - 03:17:53 CST
![]() |
![]() |