| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: foreign key
This should work for you I think Harvinder. You provide an Owner and a Table Name and it will return to you the keys plus the name of the corresponding Table and Primary keys they are referenced to .
SELECT c.owner, c.table_name, c.constraint_name,
c.r_constraint_name pkname,
c.r_owner pkowner, r.table_name pktab,
DECODE( c.status,'DISABLED',' DISABLE',' ') status,
DECODE( c.delete_rule,
'CASCADE',' ON DELETE CASCADE ',
' ') del_rule
FROM dba_constraints c,
dba_constraints r
WHERE c.owner = '&owner'
AND c.table_name = '&table'
AND c.constraint_type='R'
AND c.r_owner = r.owner
AND c.r_constraint_name = r.constraint_name
-----Original Message-----
Sent: Friday, June 01, 2001 1:23 PM
To: Multiple recipients of list ORACLE-L
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
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Harvinder Singh
INET: Harvinder.Singh_at_MetraTech.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).
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:17:26 CDT
![]() |
![]() |