问题描述
假设您有一个定义了RECORD
类型的PL/SQL包:
Suppose you have a PL/SQL package with a RECORD
type defined:
CREATE OR REPLACE PACKAGE TEST_PACKAGE AS
TYPE PERSON_RECORD_TYPE IS RECORD
(
first_name VARCHAR2(1000),
last_name VARCHAR2(1000)
);
END;
是否可以获取TEST_PACKAGE.PERSON_RECORD_TYPE
中包含的字段列表?例如,是否有ALL_*
个视图包含此信息?
Is there any way to obtain a list of fields contained within TEST_PACKAGE.PERSON_RECORD_TYPE
? For example, are there any ALL_*
views with this information?
我对 schema 级别的记录类型不感兴趣,仅对 package 级别的记录类型感兴趣.
I am not interested in schema-level record types, only package-level record types.
推荐答案
如果将PERSON_RECORD_TYPE用作某些过程或函数的参数或结果类型,则可以查询ALL_ARGUMENTS.那里的信息很少加密(记录和集合的多层封装的层次结构在POSITION,SEQUENCE和DATA_LEVEL列中进行了编码),但是仍然存在.
If PERSON_RECORD_TYPE is used as argument or result type of some procedure or function, you can query ALL_ARGUMENTS. The information is little bit encrypted there (the hierarchy of multilevel encapsulation of records and collections is encoded in POSITION,SEQUENCE and DATA_LEVEL columns), however it is present.
我不认为这样的问题指向错误的体系结构.对于自动PLSQL代码生成,这是完全合法的请求,不幸的是,其对PLSQL语言的支持非常弱.
I don't think such a question points to wrong architecture. For automatic PLSQL code generation this is completely legitimate request, unfortunately with very weak PLSQL language support.
这篇关于有关PL/SQL包级记录类型的元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!