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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: A "modification time" question

Re: A "modification time" question

From: Rachel Carmichael <carmichr_at_hotmail.com>
Date: Thu, 16 Aug 2001 05:56:18 -0700
Message-ID: <F001.0036CE4D.20010816060049@fatcity.com>

Okay, can you add a trigger?

At a prior job, management wanted us not only to track last update/insert but WHAT was done.

so I created a second table, duplicate of the first with addition fields of "trans_date","user" and "action"

then I added a trigger (insert/update/delete) on the original table.

if the action was an insert, I inserted a row into the second table, trans_date=sysdate, user=user and action=I

if a delete, I inserted a row into the second table, trans_date=sysdate, user=user and action=D

if an update, I inserted two roww into the second table, the first had the original row, trans_date=sysdate, user=user and action=O (old values) the second had the new row, trans_date=sysdate, user=user and action=N(new values)

the secondary table could be archived/purged as necessary

>From: Andrey Bronfin <andreyb_at_elrontelesoft.com>
>Reply-To: ORACLE-L_at_fatcity.com
>To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
>Subject: A "modification time" question
>Date: Thu, 16 Aug 2001 03:15:49 -0800
>
>Dear gurus !
>Is there a way to know the time of insert/update for each row in a table ?
>Or , which rows in a table were inserted/updated since a certain time.
>( Sort of find ... -mtime ... for UNIX files) .
>I CAN NOT modify the structure of the table , i.e. i CAN NOT add a
>timestamp or other column , just need to deal with what is present.
>Thanks a lot for your help !!!
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Andrey Bronfin
> INET: andreyb_at_elrontelesoft.com
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).



Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rachel Carmichael
  INET: carmichr_at_hotmail.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Aug 16 2001 - 07:56:18 CDT

Original text of this message

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