Transaction Processing in Teradata Session Mode | SQL Fundamentals | Vantage - Transaction Processing in Teradata Session Mode - Advanced SQL Engine - Teradata Database

SQL Fundamentals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
zwv1557098532464.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1141
lifecycle
previous
Product Category
Teradata Vantageâ„¢

A Teradata SQL transaction can be a single Teradata SQL statement, or a sequence of Teradata SQL statements, treated as a single unit of work.

Each request is processed as one of the following transaction types:
  • Implicit
  • Explicit
  • Two-phase commit (2PC)

Implicit Transactions

An implicit transaction is a request that does not include the BEGIN TRANSACTION and END TRANSACTION statements. The implicit transaction starts and completes all within the SQL request: it is self-contained.

An implicit transaction can be a:
  • Single DML statement that affects one or more rows of one or more tables.
  • Macro or trigger containing one or more statements.
  • Request containing multiple statements separated by SEMICOLON characters. SEMICOLON characters can appear anywhere in the input line. The Parser interprets a SEMICOLON at the end of an input line as the request terminator.

DDL statements are not valid in a multistatement request and are therefore not valid in an implicit multistatement transaction.

Explicit Transactions

In Teradata session mode, an explicit transaction contains one or more statements enclosed by BEGIN TRANSACTION and END TRANSACTION statements. The first BEGIN TRANSACTION initiates a transaction and the last END TRANSACTION terminates the transaction.

When multiple statements are included in an explicit transaction, you can only specify a DDL statement if it is the last statement in the series.

2PC Rules

2PCprotocol is supported in Teradata session mode:
  • A 2PC transaction contains one or more DML statements that affect multiple databases and are coordinated externally using the 2PC protocol.
  • A DDL statement is not valid in a two-phase commit transaction.