Database Reference
In-Depth Information
SET Customer_state = Upper(Customer_state)
WHERE Customer. Customer_id = :OLD. Customer_id END;
7.3.5 Commit and Rollback
Rollback
A ROLLBACK statement is explicitly defined in the transaction. When the
statement is executed, actions are undone, the database is returned to the state it was in
when the transaction was initiated, and the transaction is terminated. If the ROLLBACK
statement references a save point, only the actions taken after the save point are undone,
and the transaction is not terminated. The program that initiated the transaction is interrup-
ted, causing the program to abort. In the event of an abnormal interruption, which can be
the result of hardware or software problems, all changes are rolled back, the database is
returned to its original state, and the transaction is terminated. A transaction terminated in
this way is similar to terminating a transaction by using a ROLLBACK statement.
Commit
A COMMIT statement is explicitly defined in the transaction. When the statement is ex-
ecuted, all transaction-related changes are saved to the database, and the transaction is ter-
minated. The program successfully completes its execution. All transaction-related changes
are saved to the database, and the transaction is terminated. Once these changes are com-
mitted, they cannot be rolled back. A transaction terminated in this way is similar to ter-
minating a transaction by using a COMMIT statement.
Syntax of COMMIT:
COMMIT ;
Syntax of ROLLBACK:
ROLLBACK ;
Search WWH ::




Custom Search