Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Returning resultset from Stored proc
Thanks. I don't understand some of it though. What's a ref cursor?
Why must I create a package to be able to do this?
thanks,
Hugh Pendry wrote:
> Yes
>
> (following syntax may be a bit off)
>
> declare a ref cursor type in a package:-
> e.g.
> CREATE OR REPLACE
> PACKAGE MyPackage
> type myRefCursor is ref cursor;
>
> then pass this as a parameter to your stored proc:-
> e.g.
> procedure GetEmployees
> (
> boss_in IN varchar2,
> employees_inout IN OUT MyPackage.myRefCursor
> )
> is
> begin
> open employees_inout for
> select
> employeeID,
> employeeName,
> from
> employee
> where
> boss = boss_in;
> end;
>
> kev wrote in message <38B4FE71.EBE3BF84_at_fast.no>...
> >Hi,
> >
> >I want to write a stored procedure which will perform a query and return
> >the result. I know how to return values via IN OUT variables, but can I
> >return a whole resultset?
> >Example code would be appreciated, the simpler the better.
> >
> >thanks,
> >
> >- Kev
> >
Received on Thu Feb 24 2000 - 08:22:09 CST
![]() |
![]() |