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: Alexei Fox <afox_at_rogers.com>
Date: Sun, 15 Sep 2002 12:47:07 GMT
Message-ID: <fj%g9.23898$U_.11713@news04.bloor.is.net.cable.rogers.com>

Simply remove "for each row". Your logic does not require it. This will make your trigger "statement-level" instead of "row level", and the "mutating table error" will not be raised. Alexei

"eugene kim" <eugene1977_at_hotmail.com> wrote in message news:am1fru$vkd$1_at_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 - 07:47:07 CDT

Original text of this message

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