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: Can Oracle do this!?

Re: Can Oracle do this!?

From: Greg Akins <gakinsNOgaSPAM_at_gatewayhealthplan.com.invalid>
Date: 2000/08/08
Message-ID: <0029fe72.167300d6@usw-ex0106-045.remarq.com>#1/1

In Oracle the keyword RETURN returns values and exits the function. Is this what you're looking for? In your program
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) ...
It looks like teh program will always terminate with Query values. Doesn't suspend exit the function?

So
BEGIN
Rec_found := '00' ;
for my_rec in (SELECT a, b FROM myTable WHERE c = 'XXXX') loop
  if emp_rec.RA = '01' then
    return my_rec.RB ; <- Exits
  end if ;
end loop ;
return Rec_found ; <- Exits
END ; Or some such thing?

-greg


Got questions? Get answers over the phone at Keen.com. Up to 100 minutes free!
http://www.keen.com Received on Tue Aug 08 2000 - 00:00:00 CDT

Original text of this message

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