Specifying Transaction Names in UPDATE
Go Up to Updating Data (Embedded SQL Guide)
InterBase enables a SQL application to run simultaneous transactions if:
- Each transaction is first named with a
SET TRANSACTIONstatement. For a complete discussion of transaction handling and naming, see Working with Transactions.
- Each data manipulation statement (
CLOSE) specifies a
TRANSACTIONclause that identifies the name of the transaction under which it operates.
- SQL statements are not dynamic (DSQL). DSQL does not support multiple simultaneous transactions.
TRANSACTION clause intervenes between the
UPDATE keyword and the name of the table to update, as in the following syntax:
UPDATE [TRANSACTION name] table SET col = <assignment> [, col = <assignment> ...] WHERE <search_condition> | WHERE CURRENT OF cursorname;
TRANSACTION clause must be used in multi-transaction programs, but is optional in single-transaction programs or in programs where only one transaction is open at a time. For example, the following
UPDATE is controlled by the transaction,
EXEC SQL UPDATE TRANSACTION T1 DEPARTMENT SET BUDGET = 2505700 WHERE DEPARTMENT = 'Publications';