Updating Rows in a Database with Transactions

If you are updating rows in a database with transactions, and you are using transactions, you can undo the update using the ROLLBACK WORK statement. If you do not execute a BEGIN WORK statement before the update, and the update fails, the database server automatically rolls back any database modifications that were made to the table since the beginning of the update operation.

The CREATE TEMP TABLE statement can include the WITH NO LOG option to create temporary tables that do not support transaction logging. These tables are not logged and are not recoverable.

Do not use RAW tables within a transaction. Tables that you create with the CREATE RAW TABLE statement are not logged. Thus, RAW tables are not recoverable, even if the database uses logging. RAW tables are intended for the initial loading and validation of data. After you have loaded the data, use the ALTER TABLE statement to change the table to type STANDARD, and perform a level-0 backup before you use the table in a transaction. For more information about RAW tables, refer to the HCL OneDB™ Administrator's Guide.

In an ANSI-compliant database, transactions are implicit, and all database modifications take place within a transaction. In this case, if an UPDATE statement fails, you can use ROLLBACK WORK to undo the update.

If you are within an explicit transaction, and the update fails, the database server automatically undoes the effects of the update.