本文介绍了获取包中声明的所有变量和常量名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用数据字典获取给定架构中的包中定义的所有变量和常量的列表.
I need to get list of all variables and constants defined in packages within given schema using data dictionary.
找不到任何信息.有什么建议吗?
Couldn't find any information how to do it. Any suggestions?
推荐答案
PL/Scope可以提供此功能,尽管它是您需要显式启用的编译器选项.
PL/Scope can provide this, although it's a compiler option that you need to enable explicitly.
-
启用PL/范围
Enable PL/Scope
alter session set plscope_settings = 'IDENTIFIERS:ALL';
重新编译架构或选定的对象,例如(这将重新编译所选模式的所有对象:
Recompile the schema or selected objects, e.g. (this will recompile all objects for the selected schema:
exec dbms_utility.compile_schema('MYSCHEMA',TRUE);
现在,您可以查询当前用户拥有的对象中的所有标识符:
Now you can query for all identifiers in objects owned by the current user:
select * from user_identifiers;
这篇关于获取包中声明的所有变量和常量名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!