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 -> tigger to store info on change

tigger to store info on change

From: John <jriker1_at_yahoo.com>
Date: 19 Sep 2002 04:02:18 -0700
Message-ID: <e6bb5a8d.0209190302.1dedf749@posting.google.com>


I am working on some audit trail stuff, and was requested to do the following:

  1. When a new entry is placed in any table, log that it's an insert, the column names in the table that the insert is on, and the values being put in. Log this to a table say called AUDIT.
  2. When an update is done, log that it's an update, the column names in the table that is having the data updated, and the ORIGINAL values before the update to the AUDIT table.
  3. Same with deleting.

Now I think in step two it should log the new value since the original one is already in the audit log, but it is felt by others that they can look at the actual table the data is stored in and retrieve the current value, so the original one is more relevant. With that said, does anyone have a sample of a trigger I can put on all my tables to accomplish the above?

Figured I would have the AUDIT table with a auto-increment primary key, a column that says if it was an insert/update/delete, one to store the column names and data(or maybe two seperate for this part). Any help would be appreciated in accomplishing this. Thanks.

JR Received on Thu Sep 19 2002 - 06:02:18 CDT

Original text of this message

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