Solved

How to get dependent table name by query

Posted on 2004-09-10
5
574 Views
Last Modified: 2012-05-05
Hi
For a given table, how can I get the table names which depend on it  by query?

Thanks
0
Comment
Question by:oldyyy
5 Comments
 
LVL 23

Expert Comment

by:seazodiac
ID: 12032002
you mean in Oracle? and you mean child tables(FK tables) by dependent tableS?
0
 
LVL 14

Assisted Solution

by:leoahmad
leoahmad earned 150 total points
ID: 12032183
For Parent child relationship:

select p.table_name PARENT_TABLE, c.table_name CHILD_TABLE
from user_constraints p, user_constraints c
where (p.constraint_type = 'P' OR p.constraint_type = 'U')
and c.constraint_type = 'R'
and p.constraint_name = c.r_constraint_name
/

For dependant objects like procedure,functions,views:

SQL> @ utldtree -- find in yr database folder.
SQL> Execute deptree_fill('TABLE','SCOTT','EMP');

Here a message should display that the procedure successfully completed.

then you can query as

SQL> select * from deptree;
SQL> select * from ideptree;

Hope this help

LeoAhmad
0
 
LVL 13

Accepted Solution

by:
riazpk earned 350 total points
ID: 12034057
0
 

Author Comment

by:oldyyy
ID: 12044804

Thanks all.
 for seazodiac
 Yes, I  mean in oracle to get child tables(FK tables) by dependent tableS.
0
 
LVL 13

Expert Comment

by:riazpk
ID: 12053070
Please finalize this question and award the points.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
null value 15 94
EXECUTE IMMEDIATE 5 53
query in Oracle forms Builder 2 41
Why  don't I see Below columns in my  Stored Procedure  under TMP_RS? 8 17
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now