Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Can a stored procedure or function return a recordset
In article <8klhei$gkj$1_at_acs2.byu.edu>,
"Jake Anderson" <jakeanderson_at_byu.edu> wrote:
> I know this is a dumb question but I am kind of new at oracle. I am
almost
> certain that it is possible but I can't seem to do it.
> How would I get a function or procedure to return a recordset. I just
want
> it to return the results of a select query. But I can't use a view
because
> it has parameters. Unless you can do parameters in a view. Which I
also
> wouldn't know how to do. Thanks for the help.
>
> --
> Jake Anderson
> jakeanderson_at_byu.edu
> MTC Development
>
>
Hi,
you've got two possibilities to return result sets.
1. Use REF CURSOR Types as Output variables and then fetch from the
cursor which was opened in the procedure or function.
2. If you know the structure of the result set you can define a
VARRAY-Type which will be filled inside the procedure and can be read in
the calling PL/SQL-Block.
Both methods can be used with OCI too. Yust read the Oracle manuals
(PL/SQL Programming and OCI) for further details.
Hope this helps a little bit
Martin
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Jul 14 2000 - 00:00:00 CDT
![]() |
![]() |