Views and the LOCKING Request Modifier - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

When a view is defined with a LOCKING modifier, the specified lock is placed on the underlying base table set each time the view is referenced in an SQL statement.

Overriding LOCKING FOR READ in a View

A LOCKING modifier that specifies locking for ACCESS can be used in a CREATE VIEW statement to give concurrent access to ad hoc users and users who may modify the data.

A READ lock in a view can be overridden by placing a LOCKING ... FOR ACCESS modifier on the view.

For example, assume that an ad hoc user selects data at the same time another user attempts to modify the data. The READ lock placed by the ad hoc user prevents the modifying user from accessing the data because update transactions require a WRITE lock. By creating a view for the ad hoc user that specifies an ACCESS lock, that user cannot prevent a modifying user from completing any desired table modifications.

An ACCESS lock allows data to be retrieved during write activities. A view defined with an ACCESS lock might display inconsistent results.