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 to Capture Changes

Re: Trigger to Capture Changes

From: Johannes Wilhelm <x15_at_aixserv2.urz.uni-heidelberg.de>
Date: 1997/04/03
Message-ID: <5hvjhe$9f2@sun0.urz.uni-heidelberg.de>#1/1

Lun Wing San (Oracle) (wslun_at_qrcsun.qrc.org) wrote:
: Ed Jennings wrote:
: >
: > I have a table that contains 28 columns of very sensitive data. I have
: > a trigger in place to capture current rows and write them to an audit
: > table prior ro inserts, updates, and deletes. What I really need is a
: > way to capture just the columns that have changed, and generate a report
: > containing just the changes. I'd like some advice while I'm in the
: > planning stages of this effort. Any insight will be appreciated.
 

: I think you need use database triggers to handle your requirements during
: comparisons of old values and the new values.
 

: ---
: Name : Lun Wing San (Certified Oracle Database Administrator)
 

: Title : Oracle Database Administrator and System Administrator of QRC
: Phone : (852)27885841
 

: This posting represents the personal opinions of the author. It is not the
: official opinion or policy of the author's employer. Warranty expired when you
: opened this article and I will not be responsible for its contents or use.



Write a trigger like this:

CREATE OR UPDATE TRIGGER monitor BEFORE INSERT OR UPDATE FOR EACH ROW BEGIN
   if (:old.item!=:new.item) then
     **monitor action**
   end if;
END; It's a simple method to build all combinations you want.

Johannes Wilhelm

johannes.wilhelm_at_urz.uni-heidelberg.de Received on Thu Apr 03 1997 - 00:00:00 CST

Original text of this message

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