select owner, constraint_name, constraint_type,
table_name, r_owner, r_constraint_name
from all_constraints
where constraint_type='R'
and r_constraint_name in
(
select constraint_name
from all_constraints
where constraint_type in ('P','U')
and table_name='TABLE NAME'
);
select table_name, column_name
from user_tab_columns
where column_name like '%K_AGREEMENT_ID'
where column_name like '%K_AGREEMENT_ID'
The second naming structure in use is were we prefix each column with a TLA for the name and name keys with a _LKEY suffix. So to find all customer (CST) foreign keys we can use
select table_name, column_name
from user_tab_columns
where column_name like '%_CST_LKEY'
where column_name like '%_CST_LKEY'
No comments:
Post a Comment