Go Up to Ending a Transaction
COMMIT to write transaction changes permanently to a database.
COMMIT closes the record streams associated with the transaction, resets the transaction name to zero, and frees system resources assigned to the transaction for other uses. The complete syntax for
EXEC SQL COMMIT [TRANSACTION name] [RETAIN [SNAPSHOT] | RELEASE dbhandle [, dbhandle ...]]
For example, the following C code fragment contains a complete transaction. It gives all employees who have worked since December 31, 1992, a 4.3% cost-of-living salary increase. If all qualified employee records are successfully updated, the transaction is committed, and the changes are actually applied to the database.
. . . EXEC SQL SET TRANSACTION SNAPSHOT TABLE STABILITY; EXEC SQL UPDATE EMPLOYEE SET SALARY = SALARY * 1.043 WHERE HIRE_DATE < '1-JAN-1993'; EXEC SQL COMMIT; . . .
COMMIT affects only the default transaction,
GDS__TRANS. To commit another transaction, use its transaction name as a parameter to