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: Returning a result set from procedure

Re: Returning a result set from procedure

From: James Arvigo <Hooper_X_at_Spam_Rage.com>
Date: Tue, 25 Aug 1998 17:10:40 -0500
Message-ID: <35E33660.36415C7E@Spam_Rage.com>


Sergey,

Here's an example of an Oracle stored procedure I wrote that returns a result set:

PACKAGE types as

   type customer_cursor_type is ref cursor return customer%rowtype;    type dialup_cursor_type is ref cursor return dialup%rowtype; end types;

CREATE OR REPLACE PROCEDURE
getcustlist(custrows in out types.customer_cursor_type) as begin

   open custrows for select * from customer order by cust_id; end getcustlist;

--
James Arvigo


> Hi,
> I work with Oracle 7.1 Server.
> Can I create procedure or function or smth returning a result set?
> I know I could manage it with MSSQL
> It would be
>
> CREATE PROCEDURE MY_PROC @PAR1 VARCHAR(10)
> AS
> SELECT * FROM MY_TABLE
> WHERE MY_TABLE.NAME = @PAR1
>
> View or snapshot would hardly suit because the result set depends on
> parameters very complexly.
> Thank You.
Received on Tue Aug 25 1998 - 17:10:40 CDT

Original text of this message

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