SELECT a.table_name, c.column_name, b.table_name AS CHILD_TABLE, d.column_name, b.R_CONSTRAINT_NAME
FROMuser_constraints a, user_constraints b, user_ind_columns c, user_cons_columns d
WHERE a.constraint_type = 'P' AND
a.CONSTRAINT_NAME = b.R_CONSTRAINT_NAME AND
b.CONSTRAINT_TYPE = 'R' AND
a.table_name = c.table_name AND
a.constraint_name = c.index_name AND
b.CONSTRAINT_NAME = d.constraint_name AND
a.table_name = '
In the above query substitute the required table name at the end of where clause to find the list of child tables for the given parent table.
substitute "TABLE_NAME" with your parent_table_name
Blog Owner
Labels
- Android (3)
- Database Concepts (2)
- Gujarati - હાસ્ય લેખન (4)
- Jainism (4)
- jasper report (6)
- Java Development (7)
- Oracle Query (4)
- Tips n Tricks (4)
- Useful Technology (7)
- XML Processing Using JAVA (2)
Facebook Badge
Facebook Badge
Blog Archive
Followers
Give away of the day
WHERE E.DEPT_ID = D.DEPT_ID
WHERE E.DEPT_ID = D.DEPT_ID