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

Teradata Vantage™ - SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
vnq1596660420420.ditamap
dita:ditavalPath
hoy1596145193032.ditaval

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.