Home » SQL & PL/SQL » SQL & PL/SQL » dependency question
dependency question [message #659262] Tue, 10 January 2017 13:19 Go to next message
desmond30
Messages: 41
Registered: November 2009
Member
create table tab1(x number);

create or replace view v1
as 
select x from tab1;

create or replace view v2
as
select * from v1;


I am trying to write a query that given a table, gives me all the objects (directly and indirectly) dependent on the table

select *
FROM dba_dependencies
WHERE owner = 'MYSCHEMA'
AND referenced_name IN ('TAB1')


the above only gives me V1, what else need I write to get V2, and if V2 is used by is used by a package , then that package name and so on
Re: dependency question [message #659263 is a reply to message #659262] Tue, 10 January 2017 13:52 Go to previous message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You have to recursively query.
See the following links:
To get the tree list of the objects depending of an object
To get the tree list of the objects on which an object depends

Previous Topic: separate 2 columns into 2 rows
Next Topic: Recursive SQL Insert
Goto Forum:
  


Current Time: Fri Apr 19 08:59:39 CDT 2024