Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Stupid newbie question about foreign keys
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