Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> OLD copy of record---AUDIT TRAIL--How To?
We have the need to keep an audit trail of the data that exists in a few tables. That means making a copy of the record before any changes/deletes are commited.
Question: what is the best way to do it?
I thought of two ways to do it, both thru BEFORE UPDATE/DELETE triggers. One would save the "old" copy in the same table. Other method calls for inserting the changed/deleted record in a separate tableX_Change or tableX_Delete table. How would you do it? Also, when moving records in a trigger, you have access to "old" values. Is there any way to reference the ":old.*" values which don't require specifying each single column name in the "values" section of the insert SQL in trigger---that way I don't have to update the trigger if table structure ever changes!
Thanks very much for your help!!!
Regards,
nasir (nnoor_at_cris.com)
Received on Thu Nov 12 1998 - 00:00:00 CST
![]() |
![]() |