Example: Executing a MERGE Update Request When Both the Target Table and the Source Table Have Row-Level Security Constraints - Teradata Database - Teradata Vantage NewSQL Engine

SQL Data Manipulation Language

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
fbo1512081269404.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™
Assume that:
  • The user logged onto this session has the OVERRIDE UPDATE CONSTRAINT row-level security privilege on table_1.
  • Both table_1 and table_2 have the same set of row-level security constraints.

The update of table_1 is valid and Teradata Database takes the constraint values for target table table_1, which are not specified in the request, from the constraint values defined for source table table_2.

     MERGE INTO table_1 AS target
     USING table_2 AS source
     ON (target.col_1 = source.col_1) 
     WHEN MATCHED THEN
     UPDATE SET level = source.col_2;