SESSION TRANSACTION
Purpose
Specifies whether transaction boundaries are determined by Teradata SQL semantics or ANSI standards.
Syntax
where:
Syntax Element |
Specifies that Transaction Boundaries will be Determined by |
ANSI |
ANSI standards, with implicit transaction start and explicit transaction end by COMMIT or ROLLBACK. |
BTET |
Teradata SQL BEGIN TRANSACTION and END TRANSACTION semantics. BTET mode as described here is also referred to as Teradata mode elsewhere. |
Usage Notes
Use the SHOW CONTROLS command to see the current setting of the TRANSACTION option. For details, see “SHOW CONTROLS” on page 307.
Before changing the SESSION TRANSACTION setting, all Teradata Database sessions must be logged off. Otherwise, the current setting remains in effect and BTEQ displays the following warning message:
*** Warning: You must not be logged on to change the SQLFLAG or TRANSACTION settings.
After a successful logon, BTEQ displays:
*** Transaction semantics are "%s"
where the “%s” string is BTET or ANSI, depending on the Teradata Database default value and any specification used with the SESSION TRANSACTION command.
In addition to defining transaction boundaries, setting the TRANSACTION option also affects the following functions:
For details on running in ANSI versus BTET (also referred to as Teradata mode) mode, see SQL Fundamentals.
The SESSION TRANSACTION command cannot be used in a Teradata SQL macro.
Example
To specify transaction boundaries according to Teradata SQL semantics, type:
.set session trans BTET;
Example
To specify transaction boundaries according to ANSI standards, type:
.set session trans ANSI:
Note: Both the SET and SESSION keywords can be omitted when entering this command.
BTEQ Response
Unless BTEQ encounters an error condition, there is no display response to the SESSION TRANSACTION command.