17.00 - Example: Using UserRoleRightsV - Teradata Database

Teradata Vantage™ - Data Dictionary

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
created_date
June 2020
category
Administration
Programming Reference
featnum
B035-1092-170K

The following SELECT statement returns all privileges granted to the current role of the user and the roles nested within the current role.

SELECT CAST(RoleName as CHAR(16)) as RoleName,
       CAST(DatabaseName as CHAR(15)) as Databases,
       CAST(TableName as CHAR(15)) as TVMs,
       CAST(ColumnName as CHAR(10)) as Columns,
       CAST(AccessRight as CHAR(5)) as AccRights,
       CAST(GrantorName as CHAR(15)) as Grantor
    FROM DBC.UserRoleRightsV
    ORDER BY 1,2,3,5;

Result:

RoleName        Databases        TVMs             AccRights  Grantor
--------------  ---------------  ---------------  ---------  ---------
roles017_r1f    roles017_3_db    roles017_3_v2    R          roles017_3
roles017_r2d    roles017_3_db    roles017_3_v2    R          roles017_3