oracle 如何获取有关用户定义类型的信息?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7467557/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 03:33:00  来源:igfitidea点击:

How to get information about a User-Defined Type?

oraclevariablesplsqluser-defined-types

提问by Oh Chin Boon

In simplicity, PL/SQL generally follow the following:

简单来说,PL/SQL一般遵循以下几点:

DECLARE 
     Variable declaration
BEGIN 
     Program Execution 
EXCEPTION 
     Exception handling
END;

I am quite new to PL/SQL and i am looking at the variable declaration section where i would like to find out more information on SALES_PRODUCT_TY_LIST.

我对 PL/SQL 很陌生,我正在查看变量声明部分,我想在其中找到有关SALES_PRODUCT_TY_LIST.

Is there a table i may look up to check on information on SALES_PRODUCT_TY_LIST, such as checking out table column information from all_tab_cols view?

是否有我可以查找的表来检查有关 SALES_PRODUCT_TY_LIST 的信息,例如从 all_tab_cols 视图中检查表列信息?

CREATE OR REPLACE PROCEDURE GET_DISCOUNTS
(
  v_have_list SALES_PRODUCT_TY_LIST
)
IS
  QUERY VARCHAR(5000);
...

Thanks.

谢谢。

回答by APC

The Oracle database has an extensive data dictionary (what some other DBMS products call the INFORMATION SCHEMA). You can find all the views here. Alas, the revised ToC structure makes it harder to find something in the 11g documentation unless you already know what you're looking for, so use the index instead. 8-)

Oracle 数据库有一个广泛的数据字典(其他一些 DBMS 产品称之为 INFORMATION SCHEMA)。您可以在此处找到所有视图。唉,修订后的 ToC 结构使得在 11g 文档中查找内容变得更加困难,除非您已经知道要查找的内容,因此请改用索引。8-)

Anyway, the views you need to query are ALL_TYPESand ALL_TYPE_ATTRS.

无论如何,您需要查询的视图是ALL_TYPESALL_TYPE_ATTRS

回答by andr

This seems to be user defined collection type. You can find some information about it querying all_types/user_typesview:

这似乎是用户定义的集合类型。您可以通过查询all_types/user_types视图找到有关它的一些信息:

select * from user_types where type_name = 'SALES_PRODUCT_TY_LIST'

The definition of the type can be found for example by querying all_source/user_sourceview:

例如可以通过查询all_source/user_source视图找到类型的定义:

select text from user_source where name = 'SALES_PRODUCT_TY_LIST' order by line

回答by Kevin Burton

Try this to get DDL:

试试这个以获得 DDL:

SELECT dbms_log.substr(dbms_metadata.get_ddl('TYPE', 'SALES_PRODUCT_TY_LIST'), 32767,1) 
FROM DUAL;

see: http://www.myoracleguide.com/s/gen_schema.htm

见:http: //www.myoracleguide.com/s/gen_schema.htm

回答by Oh Chin Boon

Ok i found something:

好的,我发现了一些东西:

select * 
from all_objects
where object_name like 'SALES%';