FirebirdSQL logo

Transaction Request Syntax

The syntax for an ODBC-friendly transaction request follows.

SET | DECLARE TRANSACTION [LOCAL] [NAME transaction-name [USING namedUniqueWorkspace]]
[READ WRITE | READ ONLY]
[WAIT | NO WAIT]
[AUTOCOMMIT]
[NO_AUTO_UNDO]
| REPEATABLE READ
| SERIALIZABLE
| READ COMMITTED [[NO] RECORD_VERSION]}]
[RESERVING table-name-1 [, table-name-2[, ...table-name-n] ]
[FOR [SHARED | PROTECTED] {READ | WRITE}] [, ]

What the Options Mean

DECLARE TRANSACTION…​ declares the described transaction, without activating it.SET TRANSACTION…​, on the other hand, activates the transaction, temporarily switching the SQL_ATTR_AUTOCOMMIT global attribute of the ODBC API to SQL_AUTOCOMMIT_OFF.The transaction will have to be finished explicitly;when it ends, the abiding rule of the API resumes.

LOCAL limits a transaction to acting only within the context of the current connection.

NAME transaction-name is a uniquely-named transaction, prepared for use by any connections in the global environment.

USING namedUniqueWorkspace is a uniquely-named transaction workspace in which NAME transaction-name can be set to run by any connections in the global environment.Identically named transactions with differing parameters can run in the same named workspace.