Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: retrieving foreign key info

Re: retrieving foreign key info

From: Chandra <chandra_at_exolink.com>
Date: Thu, 25 Jun 1998 09:18:19 -0500
Message-ID: <6mtmpl$a93$1@news-1.news.gte.net>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US