Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find the definition of a named constraint in Oracle?

Tags:

All I know about the constraint is it's name (SYS_C003415), but I want to see it's definition.

like image 962
Hank Gay Avatar asked Sep 17 '08 14:09

Hank Gay


People also ask

How do you find the constraint of a name?

Discussion: Use the view table_constraints in the information_schema schema. The column table_name gives you the name of the table in which the constraint is defined, and the column constraint_name contains the name of the constraint.

How constraint is defined in Oracle?

Oracle Constraints clause provides data integrity to the data that is being used by the application from the database by applying certain rules or conditions on a column of a database table which will define a very basic behavioral layer on the column of that particular table to check the sanctity of the data flowing ...

How do I view constraints in SQL Developer?

To open designer select table, right click and choose Edit... from context menu. In the designer dialog select Constraints option. Again, list includes all table constraints and you will distinguish FKs by Type column.


1 Answers

Looks like I should be querying ALL_CONSTRAINTS.

select OWNER, CONSTRAINT_NAME, CONSTRAINT_TYPE, TABLE_NAME, SEARCH_CONDITION from ALL_CONSTRAINTS where CONSTRAINT_NAME = 'SYS_C003415';
like image 57
Hank Gay Avatar answered Oct 18 '22 08:10

Hank Gay