Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Can Oracle do this!?
Jonas wrote at 08-Aug-00 16:51:07
on the subject "Can Oracle do this!?":
>Hi all.
Hello Jonas
>I'm trying to move my SQL code from IB to Oracle, but there are
>problems.
>In IB using a stored procedure, I can at any time return the values of
>the returns variables.
>For example:
> FOR SELECT a, b FROM myTable
> WHERE c = 'XXXX'
> INTO :RA, :RB
> DO BEGIN
> SUSPEND; <-- Fetch all returns variables (Now with the quey values)
> RA = 'AAA';
> RB = 'BBB';
> SUSPEND; <-- Fetch all returns variables (Now with my values)
> ....
>Can I do this in Oracle?
You could do something similar:
begin
for a_rec in (select a,b from mytable where c='XXXX') loop
/* Don't know what suspend does */ my_proc(a_rec.a,a_rec_b);
In the above code, a_rec is a record variable the takes the values of a and b from mytable succesively. You can acces these values in the given way.
Hope that helps,
Lothar
-- Lothar Armbrüster | lothar.armbruester_at_rheingau.vistec.net Hauptstr. 26 | lothar.armbruester_at_t-online.de D-65346 Eltville |Received on Tue Aug 08 2000 - 00:00:00 CDT