Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: retrieving foreign key info
Jim Haran wrote:
> Hi all,
> I'm using Oracle 8 on NT4 and my question is this: Is there a system
> table I can query to find out foreign key info.
> For example: I want to find out what table and column the
> department id column in a personnel table references. Any help is very
> much appreciated.
>
> Jim
Hi Jim,
You can look at user_constraints, user_cons_columns (or all_constraints and
all_cons_columns).
The r_constraint_name column in user_constraints will give you the foreign
key constraint name
and you can look that up in user_cons_columns to get the table and column
names
that the foreign key is referring to.
hope that helps,
chandra
Received on Thu Jun 25 1998 - 09:18:19 CDT