1SELECT c.OWNER, a.TABLE_NAME, a.COLUMN_NAME, a.CONSTRAINT_NAME,
2 c.R_OWNER AS REF_OWNER, cpk.TABLE_NAME AS REF_TABLE,
3 cpk.CONSTRAINT_NAME AS REF_PK
4FROM ALL_CONS_COLUMNS a
5JOIN ALL_CONSTRAINTS c ON a.OWNER = c.OWNER
6 AND a.CONSTRAINT_NAME = c.CONSTRAINT_NAME
7 JOIN ALL_CONSTRAINTS cpk ON c.R_OWNER = cpk.OWNER
8 AND c.R_CONSTRAINT_NAME = cpk.CONSTRAINT_NAME
9WHERE c.CONSTRAINT_TYPE = 'R' AND c.TABLE_NAME= 'table_name';