Get table name by constraint name

sergionni picture sergionni · Mar 9, 2011 · Viewed 129.4k times · Source

Oracle constraint name is known.

How do I find the name of the table for which this constraint is applied?

Answer

Justin Cave picture Justin Cave · Mar 9, 2011
SELECT owner, table_name
  FROM dba_constraints
 WHERE constraint_name = <<your constraint name>>

will give you the name of the table. If you don't have access to the DBA_CONSTRAINTS view, ALL_CONSTRAINTS or USER_CONSTRAINTS should work as well.