User-Defined Transactions

User-defined transactions allow users to instruct the database management system to process any number of SQL statements as a single unit and to save or cancel the unit when the work is completed. Why user-defined transactions? A classic illustration of the need for transactions comes from banking—when a customer transfers money from a savings account to a checking account. In database terms, this banking transaction consists of two operations: First updating the savings balance to reflect a debit and then updating the checking balance with the credit. Unless these two updates are treated as a single transaction to the database, the danger exists that some other user might submit a query during the interval between them. ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.