Re: PL/SQL Mutating Table with audit trigger
Date: 2000/07/27
Message-ID: <8lqdtr$ab4$1_at_nnrp1.deja.com>#1/1
I have some triggers here I think do the same thing you want.
CREATE OR REPLACE TRIGGER PROD_TIMESTAMP
BEFORE INSERT OR UPDATE
ON PRODUCT FOR EACH ROW
BEGIN
:NEW.TMSTAMP := SYSDATE;
END;
HTH
Zed Martins
In article <8lqa2c$7ka$1_at_nnrp1.deja.com>,
benitezs_at_answers.com wrote:
> I am trying to write a trigger that will update a timestamp in the
same
> table the trigger was fired from. With just a trigger I get the
> mutating table error. I was able to get around this by creating an
> update before row trigger, passing the :new and :old values to a
> package, and referencing them with an update after trigger. I also
> have to maintain a list of columns minus the timestamp column that can
> be updated to stop from an infinite update loop with the before
trigger.
>
> Does anyone know of an easier way to do this?
>
> Thanks,
> Scott Benitez
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Jul 27 2000 - 00:00:00 CEST