First page Back Continue Last page Graphics
Constraints
and the Data Dictionary
x_CONSTRAINTS and x_CONS_COLUMNS
Notes:
Listing Constraints using the Data Dictionary
A list of constraints can be retrieved from the data dictionary x_CONSTRAINTS and x_CONS_COLUMNS views (reminder: x_ refers to USER_, ALL_ and DBA_). x_CONSTRAINTS lists the information about the constraint and which table it is associated with as well as the name of any other constraint which it references (in the case of a foreign key). x_CONS_COLUMNS lists the column(s) which are included in the constraint.
In the example above we can see that :
We let Oracle name the constraints
The second column, CONSTRAINT_TYPE, contains āCā for CHECK constraints; NOT NULL constraints a actually created as CHECK constraints. āPā stands for PRIMARY KEY.
The pages that follow will show:
Describing USER_CONSTRAINTS which shows the constraints and tables
Describing USER_CONS_COLUMNS which shows the columns
A script to create a report with information from these two (2) tables
The output report