CREATE TYPE address_typ AS OBJECT (
street VARCHAR2(15),
city VARCHAR2(15),
state CHAR(2),
zip VARCHAR2(5),
phone_numbers varray_phone_typ
);
/嵌套表是不是不支持 phone_numbers varray_phone_typ?
我觉得变长数组属于UROWID for a user-defined object type
datatype Restrictions: You cannot specify attributes of type ROWID, LONG, or LONG ROW. You cannot create an object with NCLOB, NCHAR, or NVARCHAR2 attributes, but you can specify parameters of these datatypes in methods. You cannot specify a datatype of UROWID for a user-defined object type. If you specify an object of type REF, the target object must have an object identifier.  

解决方案 »

  1.   

    CREATE TYPE address_typ AS OBJECT (
    street VARCHAR2(15),
    city VARCHAR2(15),
    state CHAR(2),
    zip VARCHAR2(5),
    phone_numbers varray_phone_typ
    );
    /嵌套表是不是不支持 phone_numbers varray_phone_typ?
    我觉得变长数组属于UROWID for a user-defined object type
    datatype Restrictions: You cannot specify attributes of type ROWID, LONG, or LONG ROW. You cannot create an object with NCLOB, NCHAR, or NVARCHAR2 attributes, but you can specify parameters of these datatypes in methods. You cannot specify a datatype of UROWID for a user-defined object type. If you specify an object of type REF, the target object must have an object identifier.  
      

  2.   

    谢谢beckhambobo(beckham)与maohaisheng(),是Oracle版本问题,升级到9i后搞定
    但是又有一错误,帮忙分析一下:
    -------------------------------------------------
    CREATE TYPE nested_table_rowbeginindex AS TABLE OF CHAR(30);
    /CREATE TYPE rowindex_type AS OBJECT (
    beginIndex nested_table_rowbeginindex,
    tableName CHAR(30),
    columnName CHAR(30),
    columnValue CHAR(30)
    );
    /CREATE TYPE nested_table_rowindex AS TABLE OF rowindex_type;
    /CREATE TABLE page (
    pageName CHAR(30),
    type NUMBER,
    tableName CHAR(30),
    tabletitle CHAR(80),
    rowindex nested_table_rowindex
    )
    NESTED TABLE
     rowindex
    STORE AS
     nested_rowindex;CREATE TABLE page (
    *
    ERROR 位于第 1 行:
    ORA-02320: 无法创建嵌套表列ROWINDEX的存储表
    ORA-22913: 必须指定嵌套表列或属性的表名称
      

  3.   

    此语句不知是否要初始化呢,搞不清,多方面试试吧
    beginIndex nested_table_rowbeginindex,