Before Statement-Level Trigger v13
The following is an example of a simple before statement-level trigger that displays a message prior to an insert operation on the emp
table.
The following INSERT
is constructed so that several new rows are inserted upon a single execution of the command. For each row that has an employee id between 7900 and 7999, a new row is inserted with an employee id incremented by 1000. The following are the results of executing the command when three new rows are inserted.
The message, New employees are about to be added
, is displayed once by the firing of the trigger even though the result is the addition of three new rows.