| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: foreign keys
Ed Lufker wrote:
> What select statement would I use to see if there are any foreign
> keys on a table.
Hello Ed,
select *
from user_constraints
where Constraint_Type = 'R'
and Table_name = 'MYTABLE'
;
To see my constraints by column names I use:
column "Constraint" format A20 column "Table" format A44 column "Column" format A44
select distinct
c.constraint_name "Constraint",
c1.table_name ||'->'||c2.table_name "Table",
c1.column_name || '->' || c2.column_name "Column"
from
user_cons_columns c1, user_cons_columns c2, user_constraints c
Stephan Received on Tue Mar 03 1998 - 00:00:00 CST
![]() |
![]() |