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: Hugh Pendry <hpendry_at_trinitech.nospam.co.uk>
Date: Thu, 24 Feb 2000 11:32:40 -0000
Message-ID: <8934so$he8$1@trinitech.demon.co.uk>


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 - 05:32:40 CST

Original text of this message

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