Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of Oracle views using specific table name

I wish to find a list of all views under specific schema using mentioned table name.

e.g. if view1 and view2 uses table1, using table name "table1", I wish to find view names "view1" and view2".

Please let me know, how can I do it.

like image 428
user613114 Avatar asked Jan 09 '14 11:01

user613114


2 Answers

select 
    * 
from 
    all_dependencies
where 
    type='VIEW'
    and referenced_name like '%table_name%'
    and referenced_type = 'TABLE'
like image 59
Joe Avatar answered Oct 16 '22 19:10

Joe


Use this query:

SELECT * 
FROM all_dependencies 
WHERE TYPE = 'VIEW'
    AND referenced_type = 'TABLE'
like image 43
Wernfried Domscheit Avatar answered Oct 16 '22 19:10

Wernfried Domscheit