Friday, May 8, 2009

Get all constraints and types

List all tables with their constraints and constraint types.


SELECT OWNER,
TABLE_NAME,
CONSTRAINT_NAME,
DECODE(CONSTRAINT_TYPE, 'C','Check',
'P','Primary Key',
'U','Unique',
'R','Foreign Key',
'V','With Check Option') TYPE,
STATUS
FROM dba_constraints
ORDER BY OWNER, TABLE_NAME, CONSTRAINT_NAME

No comments:

Post a Comment

Oracle Query