16.10 - Example: Creating a View to Limit User Access - Teradata Database

Teradata Database Administration

Product
Teradata Database
Release Number
16.10
Release Date
April 2018
Content Type
Administration
Publication ID
B035-1093-161K
Language
English (United States)

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.