如何获取在给定包中声明的所有类型的数据的信息 [英] How to get information on all types of data declared in a given package

查看:114
本文介绍了如何获取在给定包中声明的所有类型的数据的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用字典视图中的信息来获取Oracle 11g中给定包中声明的所有类型的数据的信息。

How can I use information from the dictionary views to get information on all types of data declared in a given package in Oracle 11g.

推荐答案

使用PL / Scope ...

Use PL/Scope ...

alter session set plscope_settings = 'IDENTIFIERS:ALL';

...并重新编译包( UTL_LOG 在我的case)...

... and recompile the package (UTL_LOG in my case) ...

alter package utl_log compile;
alter package utl_log compile body;

...然后查询 user_identifiers view ...

... and then query the user_identifiers view ...

select name, type, object_name, object_type, line, col
from user_identifiers
where object_name = 'UTL_LOG'
    and usage = 'DECLARATION'
    and type not in ('VARIABLE','FUNCTION','FORMAL IN','FORMAL OUT','CONSTANT','PROCEDURE','FUNCTION','PACKAGE')
;

...(在我的例子中)yield ...

... which would (in my case) yield ...

NAME                TYPE    OBJECT_ OBJECT_ LINE COL
------------------- ------- ------- ------- ---- ---
ARR_SOME_COLLECTION VARRAY  UTL_LOG PACKAGE   19   6
REC_SOME_RECORD     RECORD  UTL_LOG PACKAGE   15   6
TYP_LOG_CODE        SUBTYPE UTL_LOG PACKAGE    8   9

请注意,PL / Scope可用于任何程序单元中声明/定义的任何标识符,而不仅仅是数据类型声明。

Please note that PL/Scope can be used for any identifier declared/defined in any program unit, not only for data type declarations.

这篇关于如何获取在给定包中声明的所有类型的数据的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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