Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Oracle vs. Informix (Stored Procedures)
I have worked with Informix many years. I am new to Oracle and I am trying to do something in Oracle that can easily be done in Informix. I can't seem to find the capability in Oracle without building a table.
Here is the example:
In Informix one can do the following (no syntax check):
CREATE PROCEDURE series (base INTEGER, high INTEGER)
RETURNING INTEGER; DEFINE series_num INTEGER;
FOR series_num = base TO high STEP 1
RETURN series_num;
END FOR
END PROCEDURE
In ESQL/C one can use the procedure as follows:
$char str[1024];
$long num;
$str = "EXECUTE PROCEDURE series(?, ?)";
$PREPARE series_id FOR $str;
$DECLARE series_curs FROM series_id;
$OPEN series_curs USING 1, 50;
$FETCH series_curs INTO $num;
while ( sqlca.sqlcode == 0 ) { printf("%d\n", num); $FETCH series_curs INTO $num; }
How can I declare a procedure or function in Oracle that returns a set of values that can be accessed though a cursor in Perl or Pro*C ?
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Aug 30 2000 - 12:36:36 CDT