This example shows an INSTEAD OF trigger for inserting a new employee row into the emp_vw view. The CREATE VIEW statement creates the emp_vw view by joining the two tables. The trigger adds the corresponding new rows into the emp and dept tables, respectively, for a specific employee.
Next, insert the values into the emp_vw view. The insert action inserts a new row and produces the following output:
Similarly, if you specify an UPDATE or DELETE statement, the trigger performs the appropriate actions for UPDATE or DELETE events.