Transaction Logic
Database modifications are performed using the transaction concept. A transaction consists of the following statements:
1. INSERT, DELETE, or UPDATE statements. Such statements define the changes which are to be applied to the database.
2. A COMMIT statement which causes the changes to be applied to the database. Successful execution of a COMMIT statement causes the transaction to be closed.
A ROLLBACK statement can be used to back out any changes made to the database by the current (open) transaction.
Any rows in the database which are modified are placed in hold status until the transaction is completed. This prevents any conflicting modification by other users who must wait until the row is released at the completion of the transaction.
Transactions Containing Different Types of Statements
The execution of DDL and DCL statements can be mixed in the same transaction, but can not be mixed with the execution of DML statements.
The mixing of DML and DDL/DCL statement execution within one transaction will be detected, the violating statement execution will be rejected, and an error message will be issued. The current transaction status will not be affected. For example, in a transaction with only DDL/DCL statements, a DML statement will be considered a violating statement and vice versa.
Transaction neutral statements (PREPARE, EXECUTE, EXECUTE IMMEDIATE, and DESCRIBE) can be mixed with all other statements in one transaction. They can be contained in a DDL transaction, a DCL transaction, a mixed DDL, and DCL transaction, and also in a DML transaction.