17.00 - 17.05 - Example: Creating a View to Limit User Access - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Database Administration

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
rgu1556127906220.ditamap
dita:ditavalPath
lze1555437562152.ditaval

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.