I'm using the merge statement to merge data from a source table into a target table. The target table has an auditing column LAST_UPDATED which is updated by firing the following trigger:
IF INSERTING OR UPDATING THEN
:NEW.LAST_UPDATED := SYSTIMESTAMP;
My question is whether it is possible to modify this trigger such that it only applies to those rows that are actually updated - that is the value in the LAST_UPDATED column needs to remain the same after the execution of the merge statement for rows that already exist in the target table.
Any alternative solutions are welcome!