FK 걸려있는지 확인하기

2010. 12. 8. 13:2799. 정리전 - IT/15. SQL 따라잡기

/* FK 걸려있는지 확인 쿼리 */
SELECT * 
  FROM ALL_CONSTRAINTS
 WHERE OWNER = 'SSYADM'
   AND R_CONSTRAINT_NAME IN (SELECT CONSTRAINT_NAME FROM ALL_CONSTRAINTS
                              WHERE OWNER = 'SSYADM'
                                AND TABLE_NAME = 'TB_OM001'
                            )