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: DBA Question About Foreign Keys

Re: DBA Question About Foreign Keys

From: Valery Yourinsky <vsu_at_softexpress.ru>
Date: Tue, 2 Feb 1999 11:46:52 +0300
Message-ID: <36b6bbea.0@192.168.2.10>


>Can anyone please email me with the names of any tables or views that
>contain the names of tables that use a foreign key. I know it is in
>there somewhere but I just can't find it.
>
>Specifically, table X has a uniqe index key named X_UK on field X. I can
>easily find this information in the views dba_constraints and/or
>dba_indexes, and in the underlying tables. But how do I find the names
>of the tables that use/reference this unique index as a foreign key.

Hello Daniel!

SELECT T.owner AS TOWN, T.table_name AS TTN, T.constraint_name AS TCN,
       R.owner AS ROWN, R.table_name AS RTN, R.constraint_name AS RCN
FROM dba_constraints T, dba_constraints R
WHERE T.r_constraint_name = R.constraint_name
  AND T.r_owner = R.owner
  AND T.constraint_type='R'
/   

I hope it will be helpful... :-)

Valery Yourinsky
---
Softservice, Moscow
ORACLE PARTNER
tel/fax (095) 333-63-10, 128-18-21
http://www.softexpress.ru
ICQ# 368 97 94
second E-mail: vsur_at_usa.net Received on Tue Feb 02 1999 - 02:46:52 CST

Original text of this message

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