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 -> Creating a Last Updated trigger

Creating a Last Updated trigger

From: Sean <sean_at_kewi.net>
Date: 24 Jul 2002 15:13:37 -0700
Message-ID: <bc264b7c.0207241413.463a727e@posting.google.com>


On a particular table, I would like to have a column called "DATE_UPDATED" that notes the last time an entry was entered/modified.  The trigger before is for a BEFORE versus an AFTER which prompts a question: If I am in a package and modify a record in the table (which causes the Trigger to fire) but I then roll back, what will the updated value be? The old value or the new one that the trigger caused? Is there a way to make an AFTER trigger? It keep giving me an error if I try.

create or replace trigger trigger_request_lastUpdated before insert or update
on REQUEST
for each row
begin

        :NEW.date_updated := SYSDATE;
END;
/ Received on Wed Jul 24 2002 - 17:13:37 CDT

Original text of this message

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