Re: Trigger : table is mutating

From: Marc Billiet <someone.overthere_at_living>
Date: Fri, 19 Jan 2001 06:41:23 GMT
Message-ID: <20010119.6412393_at_slu40xxx.hae.hydro.com>


[Quoted] Yes, but if you use an autonomous transaction, you loose the whole idea

of a transaction, i.e. a rollback of the statement that caused the execution of the trigger, will not rollback the changes made by the trigger (in the autonomous transaction). If that is what you want, there  

is no problem.

Marc

>>>>>>>>>>>>>>>>>> Oorspronkelijk bericht <<<<<<<<<<<<<<<<<<

Op 2001-01-19, 6:34:55, schreef stan <stan.taylor_at_eds.com> over het them a
Re: Trigger : table is mutating:

> Try looking up autonomous transactions in Oracle Documentation. I am
> doing this from memory, but I think if you add
> PRAGMA AUTONOMOUS TRANSACTION
> in the trigger definition before the BEGIN statement, all your
> problems will be solved.
 

[Quoted] > On Thu, 11 Jan 2001 17:09:13 +0100, "J r me PERRET"
> <jperret_at_freesurf.fr> wrote:
 

> >Hi,
> >
> >What I have :
> >- A table with a column named MAIN
> >
> >What I want :
[Quoted] > >- Only one record is the main one so only one record as the column MA
IN
set
> >to Y (Yes). Others are set to N (No)
> >
> >What I tried :
> >- A trigger on the table (BEFORE UPDATE FOR EACH ROW) :
> >
> >BEGIN
> > IF UPDATING AND :NEW.main='Y' THEN
> > UPDATE AdresseFac Client SET main='N' WHERE main='Y' AND
> >ROWID!=:NEW.ROWID;
> > END IF;
> >END;
> >
> >What happened :
> >- ORA-04091: table GESCO.ADRESSEFAC CLIENT is mutating, trigger/funct
ion
may
> >not see it
> >
> >How can I deal with this problem ?
> >
> >Jerome
> >
> >
Received on Fri Jan 19 2001 - 07:41:23 CET

Original text of this message