After Statement-Level Trigger v13
The following is an example of an after statement-level trigger. Whenever an insert, update, or delete operation occurs on the emp
table, a row is added to the empauditlog
table recording the date, user, and action.
In the following sequence of commands, two rows are inserted into the emp
table using two INSERT
commands. The sal
and comm
columns of both rows are updated with one UPDATE
command. Finally, both rows are deleted with one DELETE
command.
The contents of the empauditlog
table show how many times the trigger was fired - once each for the two inserts, once for the update (even though two rows were changed) and once for the deletion (even though two rows were deleted).