BEGIN TRAN

Syntax

Format 1
>>--EXEC SQL--BEGIN TRAN-.------------------.-END-EXEC---><
                         +-transaction_name-+
Format 2
>>-EXEC SQL-BEGIN TRANSACTION.----------------.-END-EXEC-><
                             +transaction_name+

Parameters

transaction_name An optional identifier that is ignored.

Purpose

Use the BEGIN TRAN statement in AUTOCOMMIT mode to open a transaction. After you have opened the transaction in AUTOCOMMIT mode, you should execute a COMMIT or ROLLBACK statement to close the transaction and cause a return to AUTOCOMMIT mode.

The BEGIN TRAN statement provides compatibility with Embedded SQL implementations that do not conform to the ANSI SQL standard with respect to transaction management and, in particular, the Micro Focus Embedded SQL Toolkit for Microsoft SQL Server.

If you are not opening a transaction in AUTOCOMMIT mode, then this statement has no effect.

Example:

 EXEC SQL BEGIN TRANSACTION END-EXEC