Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: foreign key
Harvinder Singh wrote:
>
> Hi,
>
> How to find out that a particular table is referenced by which other tables
> i.e..other tables having foreign key referncing
> this particular table..
>
> Thanks
> Harvinder
Not totally straighforward. All the info is in DBA_CONSTRAINTS. First you must find the name of constraints of type 'P' (primary key) or 'U' (unique, can also be referenced by a foreign key) associated with your table, then (auto-join), the name of tables having a constraint of type 'R' referencing this type 'P' or 'U' constraint. There is alos a script named desc8.sql on the Oriole site which is (basically) an improved version of the 'desc' SQL*Plus command and shows, among other things, this type of info.
-- Regards, Stephane Faroult Oriole Corporation Voice: +44 (0) 7050-696-269 Fax: +44 (0) 7050-696-449 Performance Tools & Free Scripts -------------------------------------------------------------- http://www.oriole.com, designed by Oracle DBAs for Oracle DBAs -------------------------------------------------------------- -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Stephane Faroult (sfaroult_at_oriole.com) INET: sfaroult_at_oriole.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Jun 01 2001 - 14:52:52 CDT
![]() |
![]() |