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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Stupid newbie question about foreign keys

Re: Stupid newbie question about foreign keys

From: Marie-Pascale Gazeau <marie_at_lysis.ch>
Date: 1998/03/06
Message-ID: <34FFDEC1.E87C3E99@lysis.ch>#1/1

Hi Chick,

Constraint information is accessible via the USER_CONSTRAINTS view. For the Foreign Key, here is the query:
SQL> select owner, constraint_name from user_constraints where table_name = '<table name>' and constraint_type = 'R';

Moreover, you can view the columns associated with constraints via the USER_CONS_COLUMNS view. Here is the query: SQL> select column_name from user_cons_columns where owner = '<user name>' and constraint_name = '<constraint name>';

Marie

chick*nospam*green_at_gtdev.com wrote:

> I'm really new to this, but what I need is a script which will list
> all of the foreign keys for a table, and what table and column they
> come from.
>
> Can anyone help me with this?
>
> Thanks, Chick Green
>
> chickgreen_at_gtdev.com
Received on Fri Mar 06 1998 - 00:00:00 CST

Original text of this message

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