END TRANSACTION Statement | SQL Statements | Teradata Vantage - END TRANSACTION - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

Defines the completion of an explicit Teradata session mode transaction, commits the transaction, and drops its Transient Journal.

An explicit Teradata session mode transaction must always start with a BEGIN TRANSACTION statement, and you must always specify both BEGIN TRANSACTION and END TRANSACTION statements to define the limits of an explicit transaction in Teradata session mode.

See BEGIN TRANSACTION for additional usage information about END TRANSACTION.

ANSI Compliance

END TRANSACTION is a Teradata extension to the ANSI SQL:2011 standard.

The statement is valid only in Teradata session mode. If you submit an END TRANSACTION statement in ANSI session mode, the database aborts the request and returns an error.

For ANSI session mode transaction control statements, see COMMIT and ROLLBACK.

Required Privileges

None.

BEGIN TRANSACTION/END TRANSACTION Pairs and Explicit Transactions

When you code an explicit transaction in Teradata session mode, you must initiate the transaction with a BEGIN TRANSACTION statement and complete it with an END TRANSACTION statement. See BEGIN TRANSACTION.

END TRANSACTION and Multistatement Requests

There can be no more than one END TRANSACTION statement specified in a multistatement request, and that statement, if specified, must be the last statement in the request.

Differences Between the Effects of END TRANSACTION and ABORT or ROLLBACK

While an END TRANSACTION request terminates and commits a transaction and drops its Transient Journal, ABORT and ROLLBACK requests terminate a transaction with rollback. See ABORT and ROLLBACK.

In general, the rules for committing transactions using the COMMIT statement also apply to END TRANSACTION. See COMMIT.

Rules for END TRANSACTION Using Embedded SQL

The following rules apply to the use of END TRANSACTION in embedded SQL:
  • END TRANSACTION is valid only when you specify the TRANSACT(BTET) or -tr(BTET) options to the preprocessor. Otherwise, an error is returned and the precompilation fails.
  • END TRANSACTION cannot be performed as a dynamic SQL statement.
  • When END TRANSACTION is processed, the transaction, if not already aborted, is committed.