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

Home -> Community -> Usenet -> c.d.o.server -> CREATING AUDIT TRAIL in Oracle

CREATING AUDIT TRAIL in Oracle

From: Julian K. Black <julianb_at_bellsouth.net>
Date: Thu, 18 Oct 2001 07:05:41 -0700
Message-ID: <6Ryz7.2185$B3.122791@e3500-atl2.usenetserver.com>

Hi gang

 I am trying to create an audit trail for my database application. My audit trail table as the following
structure: t_audit_trail

             {user_ID  INTEGER
              date  DATE
              type_of_change  VARCHAR2(10)
    field_name VARCHAR2(30)
              table_name VARCHAR2(30)
              old_value  VARCHAR2(30)
              new_value  VARCHAR2(30) }

I am creating a before insert and update trigger row level trigger. Capturing the user_id, date, type_of_change, table_name pose no problem. The problem is with the field_name, old_value, and new_value. Some of my tables have
30 fields and I would hate to have to list the name of every field in my code. Does anyone have a suggestion other than refering to every field in my code? If so can you please provide a working example of it?

I was thinking about using the system tables to capture the field names for each table and looping thru each value and trying to capture the old and the new value. If so can you please provide a working example of it?

thanks in advance. Received on Thu Oct 18 2001 - 09:05:41 CDT

Original text of this message

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