Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: TRIGGER BEFORE UPDATE

Re: TRIGGER BEFORE UPDATE

From: Mike Madland <mikemad_at_asymetrix.com>
Date: 1996/12/18
Message-ID: <32B856AB.5EEB@asymetrix.com>#1/1

Wolf Kammer wrote:
>
> Hallo to who is looking at this,
>
> I must set the value of the columne "status" to 'C' ("Changed") as
> soon as an other column has been updated. My trigger
>
> CREATE OR REPLACE TRIGGER htbvz
>
> BEFORE UPDATE ON table
> FOR EACH ROW WHEN (new.bvz = 'Y')
> BEGIN
> UPDATE table SET status='C' WHERE :new.bvz='Y';
> END;
> /
>
> does not work since the table is mutating, that is being modified
> by the update. How can one do this simple thing?
>
> Thanks for any help, Wolf Kammer

Try it this way instead:

CREATE OR REPLACE TRIGGER htbvz  

        BEFORE UPDATE ON table
        FOR EACH ROW WHEN (new.bvz = 'Y')
        BEGIN
 	      :new.status := 'C';
        END;

/

Mike Madland
mikemad_at_asymetrix.com Received on Wed Dec 18 1996 - 00:00:00 CST

Original text of this message

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