Now on the table or tables you wish to audit you need to create a trigger that will fireevery time its inserted into, deleted from or updated etc ...Suppose we wish to track changes to our employee table. The trigger would look something like:-

Note the use of the special identifiers inserting,updating and deleting. These are built-in and available to all triggers. The above trigger fires only once even though the underlying insert etc may affect many rows of the tables. Sometimes you want the trigger to fire on every insert or delete etc ... For this you can use the FOR EACH ROW condition. If you do this the built-in correlation names old and new become available to reference old updated or deleted records and new inserted or updated records. As another example suppose you want to record whenever an employee gets a salary raise greater that 10%. Assuming the audit table is set up as:-

create or replace trigger audit_empafter update of salary on employeefor each rowbegin if new.salary/old.salary >1.1 then insert into tablechange(emp_name,old_salary,new_salary,pct_increase) values(new.emp_name,old.salary,new.salary,((new.salary/old.salary) -1)*100); end if;end;