let us say "basetab" is the base table and "audittab" is the audit table
where bastab contains
1. id NUMBER
2 name VARCHAR2
3 joindate DATE
and audittab contains
1. id_old NUMBER
2. id_new NUMBER
3. name_old VARCHAR2
4. name_new VARCHAR2
5. joindate_old DATE
6. joindate_new DATE
7. change_date DATE
User scott is the owner of both objects ...
First connect as scott ...
Second create a trigger on the basetable that fires when a record has been inserted. In this trigger you will insert the datas into your audit table.
CREATE OR REPLACE TRIGGER scott.ari_audit AFTER INSERT,
UPDATE, DELETE ON
scott.basetab REFERENCING OLD AS old NEW AS new
FOR EACH ROW
INSERT INTO scott.audittab VALUES
(ld.id, :new.id, ld.name, :new.name, ld.joindate, :new.joindate,
Thats all ...
If you want to get information about the user who has changed the record then use the DBMS_STANDARD package to get the username
and put this into your audittable.