The sequence of actions when the MERGE statement executes are as follows:
1 All BEFORE triggers associated with UPDATE actions are applied.
2 All BEFORE triggers associated with INSERT actions are applied.
3 The UPDATE operations specified by the MERGE update specification and the INSERT operations specified by the MERGE insert specification are applied.
4 The system checks any specified constraints, which might result in referential actions being executed.
5 All AFTER triggers associated with UPDATE actions are applied.
6 All AFTER triggers associated with INSERT actions are applied.