STATUS, OWNER
FROM ALL_CONSTRAINTS
WHERE R_OWNER = 'SCOTT'
AND CONSTRAINT_TYPE = 'R'
AND R_CONSTRAINT_NAME IN
(
SELECT CONSTRAINT_NAME FROM ALL_CONSTRAINTS
WHERE CONSTRAINT_TYPE IN ('P')
AND TABLE_NAME = 'EMP'
AND OWNER = 'SCOTT'
)
ORDER BY TABLE_NAME, CONSTRAINT_NAME;
No comments:
Post a Comment