5.5. USER_CONSTRAINTS

The USER_CONSTRAINTS view describes constraint types and detail attribute information on constraints. When diagnosing an Oracle constraint violation error message with a generic Oracle-generated constraint name, such as SYS_C012345, you look here to determine the type of constraint. If it is a FOREIGN KEY, then you might continue your search for the table name and column name of the parent. If it is a CHECK constraint, then you might look at the SEARCH_CONDITION to determine the rule of the CHECK constraint. When these steps are taken, you may likely look at USER_CONS_COLUMNS, using the constraint name, to determine the exact column name(s) on which the constraint is defined. The description of this view is:

 SQL> DESC user_constraints ...

Get Programming Oracle® Triggers and Stored Procedures, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.