Answers for "how to view all constraints on a table in oracle"

SQL
2

how to find constraints on a table in oracle

SELECT cons.OWNER 			AS CHILD_OWNER,
       cons.TABLE_NAME 		AS CHILD_TABLE,
       cons.CONSTRAINT_NAME AS CONSTAINT_NAME,
       cons.CONSTRAINT_TYPE AS CONSTRAINT_TYPE,
       col.OWNER 			AS PARENT_OWNER,
       col.TABLE_NAME 		AS PARENT_TABLE,
       col.COLUMN_NAME 		AS COLUMN_NAME
FROM DBA_CONS_COLUMNS col, DBA_CONSTRAINTS cons
WHERE cons.R_OWNER = col.OWNER
  AND cons.R_CONSTRAINT_NAME = col.CONSTRAINT_NAME
  AND cons.TABLE_NAME = 'table_name';
Posted by: Guest on July-11-2021

Code answers related to "how to view all constraints on a table in oracle"

Code answers related to "SQL"

Browse Popular Code Answers by Language