Oracle find all constraints
Find all cascade constraints
SELECT
lc.table_name loc_table,
lc.constraint_name loc_cons,
ln.column_name loc_col,
lc.r_constraint_name rem_cons,
rc.table_name rem_table,
rn.column_name rem_column,
lc.status,
lc.delete_rule,
lc.deferrable,
lc.deferred,
lc.validated
FROM
user_cons_columns ln,
user_cons_columns rn,
user_constraints lc
INNER JOIN
user_constraints rc ON lc.r_constraint_name = rc.constraint_name
WHERE
(rc.table_name IN ('TABLE_NAME')
OR lc.table_name IN ('TABLE_NAME'))
AND ln.constraint_name = lc.constraint_name
AND rn.constraint_name = rc.constraint_name
ORDER BY lc.table_name;
Comments