Finishing a Transaction

The Oracle syntax to end a transaction is as follows:

COMMIT [WORK]
[ COMMENT 'text'
| FORCE 'text' [, integer] ] ;

Here is the same command using Sybase syntax:

COMMIT (TRANSACTION | TRAN | WORK) (TRANSACTION_NAME)

The COMMIT command saves all changes made during a transaction. Executing a COMMIT statement before beginning a transaction ensures that no errors were made and no previous transactions are left hanging.

The following example verifies that the COMMIT command can be used by itself without receiving an error ...

Get Sams Teach Yourself SQL in 21 Days, 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.