CREATE TABLE table1(
  col1  obj1,
  col2  obj2,
  col3   obj3,
  col4    obj4,
  col5  obj5
);
/
CREATE TYPE obj1 AS OBJECT (
   col1-1  obj1-1,
   col2-2  obj1-2
);
/
CREATE TYPE obj1-1 AS OBJECT (
   scol  varchar2(20),
   sco2  varchar2(20)
);
/
CREATE TYPE obj1-2 AS OBJECT ( sco3  c_listtype );
/
CREATE TYPE c_listtype AS TABLE OF c_type;
/
CREATE TYPE c_ype AS OBJECT (  sco4  varchar2(20) );
/
以上脚本是示例,obj2等类型定义和obj1差不多,没有给出!
从下向上一个一个执行的都没有错误,最后建表时报错了
(ORA-22913: 必须指定嵌套表列或属性的表名称),
请大家帮忙!!送100分!!!

解决方案 »

  1.   

    CREATE TYPE demo_typ2 AS OBJECT (a1 NUMBER,  
       MEMBER FUNCTION getbar RETURN NUMBER); CREATE TABLE demo_tab2(col demo_typ2); 楼主你的语句嵌套了多少层了,为何要这样写法CREATE TYPE obj1-2 AS OBJECT ( sco3  c_listtype );
    /
    这句出了问题,嵌套表不允许这样写,详细写法参考帮助文档
      

  2.   

    例子:The STORE AS clause is now required in 8.0.2 and 8.0.3.  You must include this  clause when creating a table with columns or column attributes whose type is a nested table.    SQL> create type project_table as table of char(30);    
    SQL> create table dept (     
    2  budgets month_array,     
    3  projs project_table)     
    4  nested table projs store as nested_projs;    
    Table created.