Tomaz Mazej
Tomaz Mazej

Reputation: 465

Must specify table name for nested table column or attribute

I am trying to create a table in PL/SQL Developer and I am getting this error:

ORA-22913: must specify table name for nested table column or attribute

Here are all the types and tables I have created so far:

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
);
/

I get error when I finally want to run this command:

create table tab_POST_data of t_postRequest;

Upvotes: 0

Views: 2914

Answers (1)

Chris Saxon
Chris Saxon

Reputation: 9825

The orders column is a nested table type. So you need to specify the properties for this in the nested table clause

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

Upvotes: 4

Related Questions