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 Question - update a last_modified field

Re: Trigger Question - update a last_modified field

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 18 Oct 2001 20:18:22 +0200
Message-ID: <q67ustggupt5tdabtrn0muskr67kld7l18@4ax.com>


On Thu, 18 Oct 2001 01:40:18 -0600, John Harris <John.Harris_at_nurs.utah.edu> wrote:

>I would like to create a row-level trigger for a table which occurs each
>time the a row is updated. For instance, if any column changes then the
>last_modified field gets updated with sysdate.
>
>Can I use something like (I know this isn't correct, but I haven't much
>experience with this):
>
>begin
>select sysdate into :new.last_modified from dual;
>end;
>or maybe something like
>begin
>update table set table.last_modified=sysdate;
>end;
>
>Any help would be greatly appreciated.
>
>John Harris

1 is correct
2 isn't

Hth

Sybrand Bakker, Senior Oracle DBA Received on Thu Oct 18 2001 - 13:18:22 CDT

Original text of this message

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