Re: Audit table deletes

From: Peter Hurd <peter.hurd_at_marcam.com>
Date: 1995/04/22
Message-ID: <3n9o3b$34j_at_netmon.marcam.com>#1/1


In article <cooljazz.1.001619C9_at_halcyon.com>, cooljazz_at_halcyon.com says...

> I am looking for a method to audit when users delete rows
> from tables in a database. I'd like to set up the same trigger
> in each of several tables to show what user did the delete,
> what date and time the delete took place and what the keys
> of the deleted row were.

I'm sure there must be a better method than this ... but this is what immediately springs to mind...

Table xyz is the table we will audit. Create a table xyz_audit with columns appropriate to the auditing task ie. key xyz fields, a datetime field and a userid field.

Create a pre/on/post-delete trigger in the database (Oracle V7) that creates an xyz_audit record each time it fires. If you are using Oracle V6 and SQL*Forms then you can use a similar scheme when your blocks base table is xyz.

Like I say ... there is probably an Oracle V7 auditing feature that will do this more efficiently/better/easier. Could someone please write in describing that better method.

BTW - I just saw this April 9 post on the 21st. Have I somehow seen the original post and missed the replies?

Good luck cooljazz. (that sounds like a CD101.9 FM NYC advert.) Received on Sat Apr 22 1995 - 00:00:00 CEST

Original text of this message