Teradata Mode Transactions - Teradata Database

Database Introduction

Product
Teradata Database
Release Number
15.00
Language
English (United States)
Last Update
2018-09-25
dita:id
B035-1091
lifecycle
previous
Product Category
Teradata® Database

Teradata mode transactions can be either implicit or explicit. An explicit, or user-generated, transaction is a single set of BEGIN TRANSACTION/END TRANSACTION statements surrounding one or more requests. All other requests are implicit transactions.

Consider the following transaction:

    	BEGIN TRANSACTION;
    	DELETE FROM Employee
    	WHERE Name = ‘Smith T’;
    	UPDATE Department
    	SET EmpCount=EmpCount-1
    	WHERE DeptNo=500;
    	END TRANSACTION;

If an error occurs during the processing of either the DELETE or UPDATE statement within the BEGIN TRANSACTION and END TRANSACTION statements, the system restores both Employee and Department tables to the states at which they were before the transaction began. If an error occurs during a Teradata transaction, then the system rolls back the entire transaction.