SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
T-7
Rules for DDL and DML Statements
To ensure that several statements either execute successfully or not at all, you can
define one transaction consisting of several statements by using the BEGIN WORK
and COMMIT WORK statements. You can abort a transaction with the ROLLBACK
WORK statement.
COMMIT WORK and ROLLBACK WORK perform the FREE RESOURCES operation
along with transaction control. COMMIT WORK is equivalent to this sequence:
FREE RESOURCES (SQL statement)
ENDTRANSACTION (procedure call)
ROLLBACK WORK is equivalent to:
FREE RESOURCES (SQL statement)
ABORTTRANSACTION (procedure call)
Rules for DDL and DML Statements
These rules apply to DDL statements in transactions:
A DDL statement always executes within a TMF transaction or as a series of
system-defined TMF transactions.
Some DDL statements on audited tables can execute within a user-defined
transaction. Other DDL statements on audited tables, and all DDL statements on
nonaudited tables, cannot execute within a user-defined transaction.
DDL statements that cannot execute in a user-defined transaction automatically
execute in a system-defined transaction or a series of system-defined transactions. An
error occurs if you include these statements in user-defined transactions.
Whether a DDL statement on an audited table can execute within a user-defined
transaction depends on the statement and on the options you specify on the statement.
If a statement cannot be used within a user-defined transaction, the entry for that
statement says so.
These rules apply to DML statements in transactions:
DML statements in audited tables, views of audited tables, and mixed views must
be performed within a TMF transaction except when reading data with BROWSE
ACCESS.
If deadlock occurs, the statement receives error 73 and is canceled; the
transaction continues.
Note. The TMF subsystem works only on audited objects, so a transaction does not protect
operations on nonaudited objects. The simplest approach is to make all tables audited. Audited
is the default.