Solved

How to get dependent table name by query

Posted on 2004-09-10
5
576 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
Export table into csv file in oracle 10 80
help on oracle query 5 43
database upgrade 8 74
Shredding xml into an oracle 11g Database 2 44
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to recover a database from a user managed backup

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