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: getting foreign key dependencies

Re: getting foreign key dependencies

From: Michael Serbanescu <mserban_at_postoffice.worldnet.att.net>
Date: 1997/06/11
Message-ID: <339E4077.70E@postoffice.worldnet.att.net>#1/1

Try this:

select b.owner||'.'||b.table_name||'.'||b.column_name from user_constraints a, user_cons_columns b where a.column_name='<your_col_name>'

and a.table_name='<your_table_name>'
and a.constraint_type='R'
and a.r_constraint_name=b.constraint_name;

I hope this helps.

Michael Serbanescu



Hans Verbrugge wrote:
>
> Hi,
>
> Is there a simple way to check if a column is a reference to the
> primary key of another table?
>
> I need to get the names of the table and column where a foreign
> key points to.
>
> Thanks,
>
> - hans
  Received on Wed Jun 11 1997 - 00:00:00 CDT

Original text of this message

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