Auditing and Use the Triggers
Date: 1996/04/25
Message-ID: <4loboc$huo_at_watnews1.watson.ibm.com>#1/1
I must be missing something simple!
I am trying to audit the use of some tables, specifically, inserts,
updates and deletes. Is there a way within a DB trigger to determine
what type of action the user is attempting (i.e., update)? It would
be nice if there were some kind of variable I could look at such
as the "user" variable. I have not been able to find anything in
the docs. What have I tried so far? I have set auditing on for a
given table (insert,update,delete by access whenever successful)
and can see the action that took place by looking at
Audit_Trail.Action_Name using a select statement after the DML operation
(let's say an update statement). But, if I use the same statement in a
procedure called by a DB trigger (on update,delete,insert, after,
for each row) it seems that the trigger fires BEFORE the view "Audit_Trail"
(I have also tried view User_Audit_Object) is updated with the current
audit data. Therefore, the trigger is returning the previous DML
operation (action) and not the current one. Also, it seems that if you
rollback a transaction the auditing data is not rolled back. So if
I just did an insert on the audited table, then issued rollback, the
transaction gets rolled back but I still see the audit data for
that transaction in view audit_trail. Thanks.
M.Landa Received on Thu Apr 25 1996 - 00:00:00 CEST