15.10 - CONSTRAINT - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K
rls_constraint_name
Name of one or more row-level security constraints, each followed by a list of the hierarchical levels or non-hierarchical categories, valid for the constraint, which are being assigned to the profile_name.
For more information about row-level security constraints, see CREATE CONSTRAINT.
level_name
List of the hierarchical levels. Example level (hierarchical) constraint assignment:
CONSTRAINT = Classification_Level (Secret, Unclassified DEFAULT)
category_name
List of non-hierarchical categories. Example category (non-hierarchical) constraint assignment:
CONSTRAINT = Classification_Country (US, UK, GER)
There is a limit of 6 hierarchical constraints and 2 non-hierarchical constraints that can be assigned per profile.
DEFAULT
DEFAULT can be specified for 1 classification level from the specified list of levels for a hierarchical constraint. The specified level becomes the default value for the constraint when a session is established for the user to which the profile is assigned.
If you do not specify DEFAULT for any of the listed classification levels, then the first level listed becomes the default for the profile.
DEFAULT is not valid for non-hierarchical constraints.

Example: Assigning Row-Level Security Constraint Classifications to a Profile

The following example assigns a subset of classifications for two different row-level security constraints to a profile. One of the level classifications is defined as the default. The capabilities of profile members to access row-level security tables with these constraints are defined by the profile constraint assignments.

CREATE PROFILE profile_name AS
   ... ,
   CONSTRAINT = Classification_Level (Secret, Unclassified DEFAULT),
   CONSTRAINT = Classification_Country (US, UK, GER);