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: mutating table error help

Re: mutating table error help

From: eugene kim <eugene1977_at_hotmail.com>
Date: Sun, 15 Sep 2002 15:33:21 +0000
Message-ID: <am1fru$vkd$1@newsreader.mailgate.org>

ouch.. this one is really hard to solve.. i've looked at many past examples in groups.google.com but it's just overwheleming..

.............

create or replace trigger game_after after insert or update of gamedate, gamecity on games
for each row
declare val integer;
begin
select count(*) into val from games g
where (g.hometeamid = :new.visitorteamid or

        g.hometeamid = :new.hometeamid or
        g.visitorteamid = :new.hometeamid or 
        g.visitorteamid = :new.visitorteamid) and
        g.gamedate = :new.gamedate and
        g.gamecity <> :new.gamecity;
        if val > 0 then
        raise_application_error(-20000, 'No team may play two games 
in two different cities on the same day');
        end if;

end;
/
show errors Received on Sun Sep 15 2002 - 10:33:21 CDT

Original text of this message

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