Transaction with error handling idea
SQL
Medium
2 views
Problem Description
Show a generic pattern: begin, do steps, if any step fails then rollback, else commit.
Constraints
Pseudo steps in SQL
Official Solution
BEGIN; UPDATE Accounts SET balance = balance - 100 WHERE acc_id=1; UPDATE Accounts SET balance = balance + 100 WHERE acc_id=2; COMMIT;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!