关于 PL/SQL 包级记录类型的元数据

Metadata regarding PL/SQL package-level record types(关于 PL/SQL 包级记录类型的元数据)
本文介绍了关于 PL/SQL 包级记录类型的元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您有一个定义了 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?

我对模式级记录类型不感兴趣,只对级记录类型感兴趣.

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 包级记录类型的元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)
MyBatis support for multiple databases(MyBatis支持多个数据库)
Oracle 12c SQL: Missing column Headers in result(Oracle 12c SQL:结果中缺少列标题)
SQL query to find the number of customers who shopped for 3 consecutive days in month of January 2020(查询2020年1月连续购物3天的客户数量)
How to get top 10 data weekly (This week, Previous week, Last month, 2 months ago, 3 month ago)(如何每周获取前十大数据(本周、前一周、上个月、2个月前、3个月前))
Select the latest record for an Id per day - Oracle pl sql(选择每天ID的最新记录-Oracle pl SQL)