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 -> code clean up help

code clean up help

From: eugene kim <eugene1977_at_hotmail.com>
Date: Fri, 13 Sep 2002 04:10:02 +0000
Message-ID: <alqv2k$rch$1@newsreader.mailgate.org>

i use this structure many times in my trigger i know i can use exception
and do select teamid into home_team_seq_id and catch with exception when 'data_not_found' but since i got many difference cases which will generate 'data_not_found' i am selecting count(*) first and select info that i need again..  

                select count(*) into val 
                from teams t   
                where t.scid = home_school_id and
                                t.sport = :new.tsport and
                 t.gender = :new.tgender;
                                        if(val =1 ) then
                                                                
                                select teamid into home_team_seq_id 
                                from teams t
                                where scid = home_school_id and
                                        t.sport = :new.tsport and
                                        t.gender = :new.tgender;

second question
i tried to find how i can do
for var in var2 var3
loop
use var in code
end loop

only thing i can think of is
for var in 1..2
loop
if var = 1 then

        var4 := var2
else

        var4 := var3
use var4 in code
end loop

thank you Received on Thu Sep 12 2002 - 23:10:02 CDT

Original text of this message

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