【问题标题】:IS TABLE OF and AS TABLE OF when creating PL/SQL nested table collection types创建 PL/SQL 嵌套表集合类型时的 IS TABLE OF 和 AS TABLE OF
【发布时间】:2019-04-23 17:25:50
【问题描述】:

我对 PL/SQL 集合类型创建的语法使用感到好奇。在创建 PL/SQL 嵌套表集合类型(如果有)时,is table ofas table of 有什么区别?我在 Oracle 帮助文档中只看到了is table of,但我遇到的代码在创建集合类型时同时使用了is table ofas table of。我尝试了这两个语句,两个语句似乎都以相同的速度执行并按预期保存数据。

例如,对于对象类型

create or replace type new_emp_ot is object
(
    ssn number(9),
    lname varchar2(200),
    fname varchar2(200)
);

Oracle 的处理方式有什么明显的区别

create or replace type new_emp_nt as table of new_emp_ot;

create or replace type new_emp_nt is table of new_emp_ot;

?

【问题讨论】:

    标签: oop plsql types syntax nested-table


    【解决方案1】:

    ISASinterchangeable in the CREATE TYPE syntax,在这种情况下没有区别。

    虽然语法图不正确......它看起来像是 IS/AS 是可选的,但实际上你不能省略它们。

    【讨论】:

    • 谢谢。没想到去那里查。语法图也很好。
    • 我已经习惯了 Oracle 不灵活的语法,所以我不得不问,现在我惊讶地发现 create type 语句中有可互换的关键字!
    猜你喜欢
    • 2015-05-28
    • 1970-01-01
    • 2023-03-21
    • 2016-03-18
    • 1970-01-01
    • 1970-01-01
    • 2022-12-01
    • 2021-06-28
    • 2021-06-10
    相关资源
    最近更新 更多