NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
T-6
Transaction Control Statements
Transaction Control Statements
The statements in the following table control TMF transactions.
Statements that control TMF transactions can be used from SQLCI or coded in an
application.
For the TMF subsystem, the statements for each function are equivalent. Error
processing, however, depends on the language of the statement.
User-Defined and System-Defined Transactions
TMF transactions you define are called user-defined transactions. In some cases,
NonStop SQL/MP defines transactions for you. These transactions are called system-
defined transactions. System-defined transactions and the operations that cause them are
discussed in later sections.
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 the
following sequence:
FREE RESOURCES (SQL statement)
ENDTRANSACTION (procedure call)
ROLLBACK WORK is equivalent to:
FREE RESOURCES (SQL statement)
ABORTTRANSACTION (procedure call)
Function Language Transaction Control Statement
Start NonStop SQL/MP
COBOL85
C, Pascal, TAL
SCREEN COBOL
BEGIN WORK
ENTER TAL BEGINTRANSACTION
BEGINTRANSACTION
BEGIN-TRANSACTION
Commit NonStop SQL/MP
COBOL85
C, Pascal, TAL
SCREEN COBOL
COMMIT WORK
ENTER TAL ENDTRANSACTION
ENDTRANSACTION
END-TRANSACTION
Abort NonStop SQL/MP
COBOL85
C, Pascal, TAL
SCREEN COBOL
ROLLBACK WORK
ENTER TAL
ABORTTRANSACTION
ABORTTRANSACTION
ABORT-TRANSACTION