How can we get all the tables refered by a particular Table Thourgh a SQL query? For eg T1 is the Parent table of T2, How can we get T1 corresponding to T2 through a query.
Thank U all for all your consideration but I think I have found it. Its somthing like this:
select table_name from all_constraints where CONSTRAINT_NAME in (
select R_CONSTRAINT_NAME from all_constraints where CONSTRAINT_TYPE='R'
and upper(table_name) like upper('T2'))
Suppose if T1 is the parent table of T2 then This Query will give us T1 as a result. But still this Query is taking some time. Any suggestion to optimise this query and to make it more efficient is wellcomeed.
Thank U Raj but with your query we can only identify the table manually, Actually I have to embede this query in our application and needed the exact Table Name.
Your query uses functions and that prevents indexes from being used..Since all table names are upper_case in Oracle ( unless you created them badly)
you should be able to eliminate the
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.