Unanswered: Extracting database objects in their dependency order
I am having problems in extracting the database objects of a schema.
My problem is that I am able to get all the required objects. but not in the required order.
Can you please suggest the way in which I can get the required database objects in their dependency order.
thanks for the reply.
Yes I am already using the data dictionary table all_dependencies .
I am going in a recursive loop getting all the dependencies for each referenced object that is listed by using a query on all_dependencies.
select distinct owner ,referenced_type ,referenced_name
from all_dependencies where referenced_owner=pv_owner and name=pv_object_name
AND REFERENCED_NAME <> pv_object_name
and adding them to the list before the initial object that they reference.
The problem is comming when the object reference is reciprocal
i.e package1 having reference to package 2 and vice versa . In such cases my loop goes into a kind of infinite loop. To get out of that when ever a second reference is made to the object I am simply adding it to the objects list disturbing the actual order.
Can you please suggest how to over come this.
Or any alternate way to get the object in order.