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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Returning resultset from Stored proc

Re: Returning resultset from Stored proc

From: kev <kevin.porter_at_fast.no>
Date: Thu, 24 Feb 2000 14:22:09 +0000
Message-ID: <38B53E91.77B732D4@fast.no>


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

Original text of this message

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