【问题标题】:Must specify table name for nested table column or attribute必须为嵌套表列或属性指定表名
【发布时间】:2019-09-25 10:04:37
【问题描述】:

我正在尝试在 PL/SQL Developer 中创建一个表,但出现此错误:

ORA-22913: 必须为嵌套表列指定表名或 属性

以下是我目前创建的所有类型和表:

create or replace type t_bank_information as object(
  sifra_banke           VARCHAR2(20),
  sifra_agencije        VARCHAR2(20),
  sifra_poslovalnice    VARCHAR2(20),
  geslo                 VARCHAR2(20),
  sifra_delovnega_mesta VARCHAR2(20),

  constructor function t_bank_information (self in out nocopy t_bank_information) return self as result
);
/

create or replace type t_credentials as object(
  ime                   VARCHAR2(20),
  priimek               VARCHAR2(20),
  naslov                VARCHAR2(20),
  vrstaOD               VARCHAR2(20),
  stOD                  VARCHAR2(20),

  constructor function t_credentials(self in out nocopy t_credentials) return self as result
);
/

create or replace type t_order as object(
  vodilni_slog          VARCHAR2(20),
  iban_placnka          VARCHAR2(20),
  polog                 VARCHAR2(20),
  referenca_placnika    VARCHAR2(20),
  ime                   VARCHAR2(20),
  ulica_placnika        VARCHAR2(20),
  kraj_placnika         VARCHAR2(20),
  znesek                NUMBER,
  datum                 VARCHAR2(20),
  nujno                 VARCHAR2(20),
  koda_namena           VARCHAR2(20),
  namen_placila         VARCHAR2(20),
  rok_placila           VARCHAR2(20),
  iban_prejemnika       VARCHAR2(20),
  referenca_prejemnika  VARCHAR2(20),
  ime_prejemnika        VARCHAR2(20),
  ulica_prejemnika      VARCHAR2(20),
  kraj_prejemnika       VARCHAR2(20),
  vsota_dolzin_polj     VARCHAR2(20),
  rezerva               VARCHAR2(20),
  celota                BLOB,

  constructor function t_order(self in out nocopy t_order) return self as result
);
/

create or replace type t_order_arr as table of t_order;
/

create or replace type t_postRequest as object(
  orders            t_order_arr,
  credentials       t_credentials,
  bankInformation   t_bank_information,

  constructor function t_postRequest(self in out nocopy t_postRequest) return self as result
);
/

当我最终想要运行此命令时出现错误:

create table tab_POST_data of t_postRequest;

【问题讨论】:

    标签: oracle plsql types


    【解决方案1】:

    orders 列是嵌套表类型。所以你需要在nested table 子句中为此指定属性

    create table tab_POST_data 
      of t_postRequest
      nested table orders 
        store as orders_tab;
    

    【讨论】:

    • 感谢您的快速回复!我试过:创建表tab_POST_data(orders t_order_arr,credentials t_credentials,bankInformation t_bank_information)嵌套表订单存储为orders_nt;但是后来我在插入表格时遇到了麻烦!你的回答很有帮助。
    • 干杯;如果您在插入时遇到问题,请提出一个新问题!
    • 不,当按照您向我展示的方式创建表格时,插入工作正常:)
    猜你喜欢
    • 2013-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-22
    • 1970-01-01
    • 2019-06-23
    • 2011-05-18
    相关资源
    最近更新 更多