Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Finding Parent -Child & sub-child table

sandeepgupta_18Sep 7 2020 — edited Sep 7 2020

Hi All ,

I was using below query to find parent child table

SELECT M.CONSTRAINT_NAME,

M.TABLE_NAME AS MASTABLENAME,

D.TABLE_NAME AS DETTABLENAME

FROM aLL_CONSTRAINTS M, ALL_CONSTRAINTS D

WHERE M.OWNER = '*****' AND D.OWNER = '****' AND

M.TABLE_NAME = '*****' AND

M.CONSTRAINT_NAME = D.R_CONSTRAINT_NAME AND

D.CONSTRAINT_TYPE = 'R' AND M.CONSTRAINT_TYPE = 'P';

but this is some how not fulfilling the requirement because

the child table is in output also has child tables and so on..

can any one let me know how to achieve this..

thanks in advance

This post has been answered by Frank Kulash on Sep 7 2020
Jump to Answer
Comments
Post Details
Added on Sep 7 2020
4 comments
3,722 views