Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL function returning a table?
Rupesh Kapoor <rupesh_at_whowhere.com> wrote in article
<33022BAF.74B9_at_whowhere.com>...
> Hi,
>
> Is there a way to write a PL/SQL function that returns multiple rows (a
> PL/SQL table of records)?
>
> SELECT pl_sql_func() FROM table_name;
>
> returns only one row at a time.
>
>
> Thanks
> Rupesh
>
I think you want to use a cursor. Done as follows: declare cursor c1 as
select col1,col2,col3 from tab1 where col1 = 'xxx';
then you need to open it, fetch the results into a local var. and close it when you are finished. Received on Thu Feb 13 1997 - 00:00:00 CST