SELECT c_list.CONSTRAINT_NAME AS NAME,
SUBSTR (c_src.COLUMN_NAME, 1, 20) AS SRC_COLUMN,
c_dest.TABLE_NAME AS DEST_TABLE,
SUBSTR (c_dest.COLUMN_NAME, 1, 20) AS DEST_COLUMN
FROM ALL_CONSTRAINTS c_list,
ALL_CONS_COLUMNS c_src,
ALL_CONS_COLUMNS c_dest
WHERE c_list.CONSTRAINT_NAME = c_src.CONSTRAINT_NAME
AND c_list.OWNER = c_src.OWNER
AND c_list.R_CONSTRAINT_NAME = c_dest.CONSTRAINT_NAME
AND c_list.OWNER = c_dest.OWNER
AND c_list.CONSTRAINT_TYPE = 'R'
AND c_src.OWNER = '<your-schema-here>'
AND c_src.TABLE_NAME = '<your-table-here>'
GROUP BY c_list.CONSTRAINT_NAME,
c_src.TABLE_NAME,
c_src.COLUMN_NAME,
c_dest.TABLE_NAME,
c_dest.COLUMN_NAME;

Yararlı olması Dilegiyle…
Yazar : Mustafa Bektaş Tepe

362 total views, no views today