Undo part of a long transaction
SQL
Hard
3 views
Problem Description
In a long transaction you updated 3 tables. Rollback only the last table updates using savepoint.
Constraints
Use savepoint at the right time
Official Solution
BEGIN; UPDATE T1 SET col=1; UPDATE T2 SET col=2; SAVEPOINT before_t3; UPDATE T3 SET col=3; ROLLBACK TO before_t3; COMMIT;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!