如何列出oracle中特定存储过程中使用的所有表

问题描述:

我需要获取oracle中特定存储过程中使用的所有表的列表.如何使用查询获取该列表?

I Need to get the list of all the tables that is used in a particular stored procedure in oracle. how to get that list using query?

Dynamic SQL被跳过,因为在编译过程中未在SEMANTIC检查中对其进行验证

Dynamic SQLs are skipped, since they're not validated in SEMANTIC checks during compilations

select 
   proc_syn.referenced_owner, 
   proc_syn.referenced_name, 
   proc_syn.referenced_type,
   syn_tab.table_name
from 
   dba_dependencies proc_syn, dba_synonyms syn_tab, dba_tables tables
where 
     proc_syn.name= 'YOUR_PROC' 
  AND REFERENCED_TYPE in ( 'SYNONYM','TABLE')
  AND proc_syn.referenced_name = syn_tab.synonym_name
  AND syn_tab.synonym_name = tables.table_name
  AND syn_tab.owner = 'PUBLIC'
order by 
  proc_syn.referenced_owner, syn_tab.table_name;