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

Database Administration

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-10-04
dita:mapPath
pgf1628096104492.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
ujp1472240543947
lifecycle
latest
Product Category
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.