A transaction is started with the execution of the first c-treeSQL statement. A transaction is committed using the COMMIT WORK statement and rolled back using the ROLLBACK WORK statement.
If the AUTOCOMMIT option is set to ON, then ISQL treats each c-treeSQL statement as a single transaction. This prevents the user from holding locks on the database for an extended period of time. This is very critical when the user is querying an on-line database in which a transaction processing application is executing in real time.
A set of c-treeSQL statements can be executed as part of a transaction and committed using the COMMIT WORK statement. This is shown below:
<SQL statement>
<SQL statement>
<SQL statement>
COMMIT WORK ;
Instead, a transaction can also be rolled back using the ROLLBACK WORK statement as shown:
<SQL statement>
<SQL statement>
<SQL statement>
ROLLBACK WORK ;
A c-treeSQL statement starting immediately after a COMMIT WORK or ROLLBACK WORK statement starts a new transaction.