5.4. USER_CONS_COLUMNS

The USER_CONS_COLUMNS tells you what columns make up the constraint. Details about the constraint, such as whether it is a CHECK or UNIQUE constraint, are in USER_CONSTRAINTS. The SQL*Plus describe of the table is the following.

SQL> DESC user_cons_columns

Name                          Null?    Type
----------------------------- -------- -----------------
OWNER                         NOT NULL VARCHAR2(30)
CONSTRAINT_NAME               NOT NULL VARCHAR2(30)
TABLE_NAME                    NOT NULL VARCHAR2(30)
COLUMN_NAME                            VARCHAR2(4000)
POSITION                               NUMBER

OWNERThis is the owner of the table in which the constraint is enforced.
CONSTRAINT_NAMEThis is the name used in the DDL. You use this name to ALTER or DROP the constraint. If there is no constraint name specified in the DDL, Oracle creates the constraint with a format similar to SYS_C followed by a unique sequence of digits.
TABLE_NAMEThe name of the table that has the constraint.
COLUMN_NAMEThis is the column name of the constraint.
POSITIONThis applies to the concatenated primary key, unique, and foreign keys. Our STUDENT DDL creates a concatenated unique constraint on columns for a student's STATE and LICENSE. For this constraint, there are two columns and two rows in this view. The row in this view, for this constraint, will have POSITION=1 for STATE and POSITION=2 for LICENSE.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.141.206