Undo SQL

The TRANSACTION_BACKOUT feature executes SQL to backout or undo  the specific changes from the desired transactions. For example the UPDATE in the previous post is undone with this SQL statement.

update "DRH"."DEMO"
set "DEMO_NAME" = 'Demo 1'
where "DEMO_ID" = '1'
  and "DEMO_NAME" = 'Demo One';

The undo SQL identifies the specific record by including the primary key column (DEMO_ID) and¬†ensures the correct record state with the before-update value of ‘Demo One’. This helps to ensure that changes done by other transactions are not undone as well. For example if the DEMO_NAME value had been changed to ‘Demo Demo’ by another transaction then this undo would have no effect.