UCC.TABLE_NAME,
UCC.COLUMN_NAME,
DECODE (UC.CONSTRAINT_TYPE,
'P', 'Primary Key',
'R', 'Reference Key',
'C', 'Check')
"TYP E",
UC.SEARCH_CONDITION "COND",
UCC1.TABLE_NAME "REF_TABLE",
UCC1.COLUMN_NAME "REF_COLUMN",
UC.STATUS
FROM USER_CONS_COLUMNS UCC, USER_CONSTRAINTS UC, USER_CONS_COLUMNS UCC1
WHERE UCC.TABLE_NAME = '&TABLE_NAME'
AND UC.CONSTRAINT_NAME(+) = UCC.CONSTRAINT_NAME
AND UCC1.CONSTRAINT_NAME(+) = UC.R_CONSTRAINT_NAME
SELECT * FROM USER_CONS_COLUMNS
No comments:
Post a Comment