Example: Creating a View to Limit User Access - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ - Database Administration

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
tgx1512080410608.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
ujp1472240543947
Product Category
Software
Teradata Vantage

The following statement creates a view of the Employee table so that it provides access only to the names and job titles of the employees in department 300:

CREATE VIEW Views_Database.Dept300 (Associate_Name, Job_Title) AS
   SELECT Associate_Name, Job_Title
   FROM Tables_Database.Employee
   WHERE Dept_No = 300
WITH CHECK OPTION;

The WITH CHECK OPTION prevents using this view to insert a row into the Employee table, or to update any row of the Employee table where Dept_No is not 300.