?
Solved

How to get dependent table name by query

Posted on 2004-09-10
5
Medium Priority
?
592 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 450 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 1050 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

770 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