如何列出oracle中特定存储过程中使用的所有表 [英] How to list all the tables used in a particular stored procedure in oracle

查看:768
本文介绍了如何列出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;

这篇关于如何列出oracle中特定存储过程中使用的所有表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆