List of Oracle views using specific table name

user613114 picture user613114 · Jan 9, 2014 · Viewed 19.5k times · Source

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.

Answer

Joe picture Joe · Jan 9, 2014
select 
    * 
from 
    all_dependencies
where 
    type='VIEW'
    and referenced_name like '%table_name%'
    and referenced_type = 'TABLE'