Xref: alice comp.databases.oracle.server:39524
Path: alice!news-feed.fnsi.net!news.new-york.net!news-peer.gip.net!news.gsl.net!gip.net!demos!srcc!Gamma.RU!192.168.2.10!192.168.2.11
From: "Valery Yourinsky" <vsu@softexpress.ru>
Newsgroups: comp.databases.oracle.server
Subject: Re: DBA Question About Foreign Keys
Date: Tue, 2 Feb 1999 11:46:52 +0300
Organization: Cityline news server
Lines: 31
Message-ID: <36b6bbea.0@192.168.2.10>
References: <36B650DC.D5BF800E@exesolutions.com>
Mime-Version: 1.0
Content-Type: text/plain;
 charset="iso-8859-5"
Content-Transfer-Encoding: 7bit
X-Trace: news.gamma.ru 917947069 24139 195.46.160.35 (2 Feb 1999 09:17:49 GMT)
X-Complaints-To: abuse@gamma.ru
NNTP-Posting-Date: 2 Feb 1999 09:17:49 GMT
X-Newsreader: Microsoft Outlook Express 4.71.1712.3
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Cache-Post-Path: mao.cityline.ru!unknown@ppp25-5-252.cityline.ru
X-Cache: nntpcache 2.3.3b4 (see http://www.nntpcache.org/)

>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@usa.net


