Case Study: Granting SELECT on a View - Analytics Database - Teradata Vantage

SQL Data Control Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
sgu1628111251052.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
dvv1472243528022
lifecycle
latest
Product Category
Teradata Vantageā„¢

Assume that Allen creates two objects: a table named Allen.BaseTable, and a view on that table named Allen.ViewA. The system verifies that Allen has SELECT privilege on Allen.BaseTable when ViewA is created.

Also assume that Allen grants the SELECT privilege on ViewA to Bobby. Bobby then creates Bobby.ViewB, which references Allen.ViewA. The Parser verifies that Bobby has SELECT privilege on Allen.ViewA when Bobby.ViewB is created.

The following stages summarize this process:

  1. Allen creates the base table Allen.BaseTable.
  2. Allen creates the view Allen.ViewA that references Allen.BaseTable.

    He has the SELECT privilege on Allen.BaseTable.

  3. Allen grants the SELECT privilege on Allen.ViewA to Bobby.
  4. Bobby creates Bobby.ViewB that references Allen.ViewA.

    Bobby has the SELECT privilege on Allen.ViewA.

Bobby now wants to grant the SELECT privilege on Bobby.ViewB to Chuck. Bobby can grant the privilege to Chuck, but Chuck cannot use the views in a query unless Allen grants Bobby the SELECT privilege on Allen.ViewA WITH GRANT OPTION.

The same privilege is required when a macro references an object owned by a user other than its creator. For example, assume that the macro Bobby.MacroB deletes rows from Allen.ViewA.

Other users cannot execute Bobby.MacroB unless Bobby has the EXECUTE privilege WITH GRANT OPTION on Bobby.MacroB.