Re: SQL Scripts

From: Arnold Schommer <aschommer_at_fs-edv.de>
Date: 1998/12/31
Message-ID: <368B299E.B12E6568_at_fs-edv.de>#1/1


Diego Pafumi wrote:
>
> Hi Gurus and happy new Year !!!
>
> Some people hear has to Test some applications and I'd like to Audit the
> inserts/Updates that they will make inserting some data in a Table.
> I need to populate a Table with:
> test_date
> user_id
> Name of Form
> Db_Table
> Column_of_Table
> Date Inserted
>
> My question is : How can I take the User_id, the Name of Form, Db_Table
> and
> Column_of_Table ???
> My idea is tu use a Trigger for all the tables
>
> Any ideas???? Thanks !!!

The User-ID should be simple to get: SELECT USER FROM DUAL; The name of the form might be impossible to reveal - as far as i know, there is nothing that would tell a trigger, what program has made him come up.
The last, db_table/column_of_table, are beyond my knowledge. Maybe there is some way to find out, but you will have another problem: as far as i know there is no way to associate one trigger with more than one table - of course, on the other hand, you can use one general procedure called from several triggers, but it might be more efficient to write different triggers that at least "know" the name of the table affected. The colum is a further problem: if there is no way to find it by the dbms, you will have to create one trigger per column. In a similair situation i found out, that a trigger is not in all situations able to find out which of the triggering columns are really affected and which not - it can compare the before and after values, but it can not find out if one column was not mentioned in a UPDATE or if it was "updated" to its (previous) value.

I'm sorry that this does not really help you.

Arnold Schommer Received on Thu Dec 31 1998 - 00:00:00 CET

Original text of this message