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
- Query the DBC.Dependency table to find tables that have a security constraint column:
SELECT database1name, object1name from dbc.dependency where object2name='constraint_name ';
- 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
SELECT UserName from DBC.UsrAsgdSecConstraintsV where ConstraintName='constraint_name'
SELECT ProfileName from DBC.ProfileAsgdSecConstraintsV where ConstraintName='constraint_name'