Overriding LOCKING FOR READ in a View - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

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-10-04
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
Product Category
Teradata Vantage™

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 will 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. Be aware that a view defined with an ACCESS lock might display inconsistent results.