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 -> stored procedure as a table.

stored procedure as a table.

From: Antonio <acoloma_at_apdo.com>
Date: Tue, 2 Oct 2001 16:18:02 +0200
Message-ID: <9pchu4$70$1@diana.bcn.ttd.net>

    Hi!

   I am migrating from Interbase Database to Oracle 8i (8.1.7), and I have some stored procedures in Interbase that acts like a table.

    I mean:

        I have one stored procedure like this ( it has been in oracle syntax):



CREATE OR REPLACE PROCEDURE MYPROC (
    A IN VARCHAR,
    B OUT VARCHAR)
AS

    cursor c1 is
     SELECT field1 FROM table WHERE something;     cur_values c1%ROWTYPE;
begin

   open c1;
   loop

       fetch c1 into cur_values;
       exit when c1%NOTFOUND;
       b:= cur_values.field1;

       if(b=1) then b:=1000; end if;
       /*  SUSPEND */  <-- What to put here in Oracle?
   end loop;
   close c1;
end;
/

   And I want to make a select like: select * from MYPROC(a,b);    and returning each value of b when SUSPEND is called. (SUSPEND is a call from Interbase that returns the current value of "b" for each row fetched in select).

  My question is:
    How can I make this in ORACLE?

  Thanx a lot in advance!!!! Received on Tue Oct 02 2001 - 09:18:02 CDT

Original text of this message

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