17.10 - Restrictions on Dropping a Row-Level Security Constraint - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
Language
English (United States)

Before you can drop a row-level security constraint, you must remove the constraint from all objects that reference the constraint.

You can use the following example SQL requests to determine which database objects have constraint assignments.

Finding Tables and Indexes with a Security Constraint

  1. Query the DBC.Dependency table to find tables that have a security constraint column:

    SELECT database1name, object1name from dbc.dependency where object2name='constraint_name ';

  2. Run the SHOW TABLE command for each table returned by the query in step 1. The system displays the standard CREATE TABLE for the table, including any indexes that are defined on the table.

Determining Whether a Column is a Security Constraint

You can execute a HELP COLUMN statement against a column to find out whether the column is a security constraint. See HELP COLUMN.

Finding Views that Include a Security Constraint

SELECT databasename, tvmname from dbc.tvm, dbc.dbase
where
tablekind='V' and
tvm.databaseid=dbase.databaseid and
tvmid in (select tableid from dbc.tvfields where constraintid in
(select constraintid from dbc.secconstraints where constraintname='constraint_name'));

Finding Users or Profiles with an Assigned Constraint

For users:

SELECT UserName from DBC.UsrAsgdSecConstraintsV
where
ConstraintName='constraint_name'

For profiles:

SELECT ProfileName from DBC.ProfileAsgdSecConstraintsV
where
ConstraintName='constraint_name'