1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

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

Discussion in 'SQL PL/SQL' started by Ermiast, May 6, 2013.

  1. Ermiast

    Ermiast Active Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    55
    Code (Text):
    CREATE OR REPLACE TYPE AddressL_T AS OBJECT
    (
    street VARCHAR2(10),
    postalcode VARCHAR2(10),
    city VARCHAR2(20),
    email VARCHAR2(30)
    )
    /

    CREATE OR REPLACE TYPE AddressL_Table_T AS TABLE OF AddressL_T;
    /

    CREATE OR REPLACE TYPE PersonL_T AS OBJECT
    (
    PID VARCHAR2(10),
    pName VARCHAR2(20),
    dob Date,
    sex VARCHAR2(6),
    address AddressL_Table_T
    ) NOT FINAL
    /
    The above statements are done successfully, but creating table based on the parent object type as
    Code (Text):
    CREATE TABLE PersonL OF PersonL_T (PID PRIMARY KEY);
    becomes impossible.

    I'm getting
    Code (Text):
    ORA-22913 must specify table name for nested table column or attribute
    I saw many documentations, and there was a NESTED TABLE nested_table_name STORE AS nested_table_name_nt for the tables created as a sub type. How shall I create a table for this super type.

    Moreover, I want to take the PID of this table as a FOREIGN KEY to some other tables, how's that done?
     
  2. bkoniki

    bkoniki Active Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    55
    CREATE TABLE PersonL OF PersonL_T (PID PRIMARY KEY);

    I am very doubtful that oracle ever permits you to use PID outside the Object:personL_T