Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Returning a result set from procedure
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