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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL function returning a table?

Re: PL/SQL function returning a table?

From: JFK <jfk_at_mail.froggernet.com>
Date: 1997/02/13
Message-ID: <01bc1956$16a7aa60$9f7bae98@default>#1/1

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

Original text of this message

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