我试图在SQL3中定义一个在其类型声明中包含嵌套表的类型的表。我不明白为什么我总是得到同样的错误,尽管尝试了几种解决方案。这是一段代码:
create type Composite;
/
create type L_PieceComposite as table of ref Composite;
/
create type Piece as object(
name VARCHAR(20),
containedInto L_PieceComposite
)
not final not instantiable;
/
create type PieceQuantity as Object (
quantity NUMBER,
pieceref ref Piece
);
/
create type L_PieceQuantity as table of PieceQuantity;
/
create type Composite UNDER Piece(
cost NUMBER,
contains L_PieceQuantity
);
/
在我使用的另一个文件中:
create table thePieces of Piece;
CREATE TABLE theComposites of Composite NESTED TABLE contains store as tab7;
但是得到以下错误:
ORA-22913:必须为嵌套表列或属性
指定表名
有人可以帮忙吗? 感谢
答案 0 :(得分:0)
求助:结论:我们必须小心继承的表。
create table lesComposites of Composite nested table containedInto store as tab5 nested table contains store as tab6;