9

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.

2 Answers 2

12
select 
    * 
from 
    all_dependencies
where 
    type='VIEW'
    and referenced_name like '%table_name%'
    and referenced_type = 'TABLE'
11

Use this query:

SELECT * 
FROM all_dependencies 
WHERE TYPE = 'VIEW'
    AND referenced_type = 'TABLE'
2
  • 1
    Perfect :) Adding more info to your answer, to find views referencing to my specific table I added nother condition to check "referenced_name". Thanks for your help!
    – user613114
    Jan 9, 2014 at 12:21
  • 1
    Bear in mind you may want to just view the OWNER you are interested in, or at least exclude SYS. AND owner = 'MYSCHEMA'.
    – Drumbeg
    Jan 9, 2014 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.