Home » SQL & PL/SQL » SQL & PL/SQL » Primary and Foreign Key (9i)
Primary and Foreign Key [message #396368] Mon, 06 April 2009 06:08 Go to next message
rajput.anshu
Messages: 45
Registered: October 2008
Location: Bangalore
Member
Hi All,
How i will find all the tables(suppose table B,C,D) whose foreign key is refer to a primary key(table A) column...Please help me
Thanks in Advance
Any suggestion will be appreciable.
Re: Primary and Foreign Key [message #396369 is a reply to message #396368] Mon, 06 April 2009 06:11 Go to previous messageGo to next message
babuknb
Messages: 1734
Registered: December 2005
Location: NJ
Senior Member


Try to find using.

DBA_TABLES, DBA_CONSTRAINTS

Babu
Re: Primary and Foreign Key [message #396371 is a reply to message #396368] Mon, 06 April 2009 06:14 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Hi,
Join USER_CONSTRAINTS,USER_CONS_COLUMNs

Thanks & regards
Sriram
Re: Primary and Foreign Key [message #396373 is a reply to message #396371] Mon, 06 April 2009 06:20 Go to previous messageGo to next message
rajput.anshu
Messages: 45
Registered: October 2008
Location: Bangalore
Member
Let me Check.
Thanks.
Re: Primary and Foreign Key [message #396376 is a reply to message #396368] Mon, 06 April 2009 06:43 Go to previous message
cookiemonster
Messages: 12422
Registered: September 2008
Location: Rainy Manchester
Senior Member
you can do it with user_constraints alone (or all_constraints if the tables are spread over multiple schemas)
Previous Topic: check for null
Next Topic: Privilege Related Doubt
Goto Forum:
  


Current Time: Thu Dec 08 14:19:47 CST 2016

Total time taken to generate the page: 0.16587 seconds