Home » SQL & PL/SQL » SQL & PL/SQL » Foreign key constraints mapping (oracle 9.2)
Foreign key constraints mapping [message #314468] Wed, 16 April 2008 16:27 Go to next message
rkl1
Messages: 97
Registered: June 2005
Member
Dear All,

Here is one case I like to learn. For example, we have a table called T1 and it has a child table T2. Again T2 table has a child table T3. And again, table T3 has a child table T4.

Not to bore you any more:

T1 is the parent table of T2

T2 is the parent table of T3

T3 is parent table of T4

Now we know only the T1 table name and is there a query to find out all the constraint relationships from T1 all the way to T4.

I could use something like this:

select * from user_constraints
where r_constraint_name in
(select constraint_name from user_constraints
where table_name in ('T1'));

and it would show me the table T2 has Foreign key for T1. but how we see the whole picture of the family tree all the way to T4.

Thanks.





Re: Foreign key constraints mapping [message #314472 is a reply to message #314468] Wed, 16 April 2008 17:10 Go to previous message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
You are looking for Hierarchical Queries.
Previous Topic: ORA-27041: unable to open file SVR4 Error: 24: Too many open files ...
Next Topic: row_id wrong type in trigger
Goto Forum:
  


Current Time: Sat Dec 10 09:16:06 CST 2016

Total time taken to generate the page: 0.07714 seconds