这是我的OR模式的片段:
CREATE TYPE artist_table_type AS TABLE OF REF artist_type; / CREATE TYPE track_type AS OBJECT ( title VARCHAR(1000),duration INT,release_date DATE,producers artist_table_type,MEMBER FUNCTION getProducers RETURN artist_table_type,MEMBER FUNCTION getRemixers RETURN artist_table_type ); / CREATE TABLE track_obj_table OF track_type;
当我尝试运行它时,我收到错误:
CREATE TABLE track_obj_table OF track_type * ERROR at line 1: ORA-22913: must specify table name for nested table column or attribute
我怀疑这是因为track_type对象中的表类型?
解决方法
它只是意味着您必须为嵌套表提供存储子句:
sql> CREATE TABLE track_obj_table OF track_type; CREATE TABLE track_obj_table OF track_type * ERROR at line 1: ORA-22913: must specify table name for nested table column or attribute sql> CREATE TABLE track_obj_table OF track_type 2 NESTED TABLE producers STORE AS producers_nt 3 / Table created. sql> desc track_obj_table Name Null? Type ----------------------------------------- -------- ------------------------- TITLE VARCHAR2(1000) DURATION NUMBER(38) RELEASE_DATE DATE PRODUCERS ARTIST_TABLE_TYPE sql>