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: Table Trigger to set last_update_date field.

Re: Table Trigger to set last_update_date field.

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Thu, 9 Mar 2000 16:00:21 +0000
Message-ID: <1cc5jGAVq8x4EwXa@ahardy.demon.co.uk>


In article <ruPx4.9317$yV1.2222176_at_tw11.nn.bcandid.com>, Richard Billingsley <rbillingsley_at_deadend.com> writes
>I have been asked to create a table trigger that will update the
>last_update_date field for each record that is inserted or updated.
>
>Not being a trigger expert I have created the following code:
>
>create trigger set_update_date
> AFTER INSERT or UPDATE on STORM_PERSONNEL for each row
>begin
>
> update storm_personnel
> set last_update_date = sysdate
> where storm_pers_id = :new.storm_pers_id;
>
>end;
>/

change the begin..end to

begin

        :new.last_update_date := sysdate; end;

Andy
--
Andy Hardy. PGP key available on request


Received on Thu Mar 09 2000 - 10:00:21 CST

Original text of this message

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