LOCKING Examples | SQL Statements | Teradata Vantage - Example: LOCKING Request Modifier - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

The following LOCKING clause can be used to select data from the employee table while it is being modified:

     LOCKING TABLE personnel.employee FOR ACCESS
     SELECT name, salary
     FROM employee
     WHERE salary < 25000 ;
The query results may:
  • Return rows whose data can be updated or deleted an instant later by a concurrent operation initiated by another user who has obtained a WRITE lock.
  • Omit rows that are undergoing a concurrent insert operation.
  • Include rows that were not permanently inserted in the base table, because a transaction inserting the new rows was aborted and the new rows were backed out.