Updated on 2024-06-03 GMT+08:00

Managing Transactions

In the default mode, statements are committed only when EXEC SQL COMMIT is issued. The embedded SQL interface also supports autocommit of transactions by executing the EXEC SQL SET AUTOCOMMIT TO ON statement. In autocommit mode, each command is automatically committed unless it is inside an explicit transaction block. This mode can be explicitly turned off by using EXEC SQL SET AUTOCOMMIT TO OFF.

Common transaction management commands are as follows:
  • EXEC SQL COMMIT: commits an ongoing transaction.
  • EXEC SQL ROLLBACK: rolls back an ongoing transaction.
  • EXEC SQL SET AUTOCOMMIT TO ON: enables the autocommit mode.
  • SET AUTOCOMMIT TO OFF: disables the autocommit mode. This is the default mode.