Reputation: 31
I am trying to define a table in SQL3 of a type that contains a nested table in its type declaration. I do not understand why I am always getting the same error despite having tried several solutions. Here is the piece of code:
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
);
/
In another file I use:
create table thePieces of Piece;
CREATE TABLE theComposites of Composite NESTED TABLE contains store as tab7;
But get the following error:
ORA-22913: must specify table name for nested table column or attribute
Could anyone help?
Thanks
Upvotes: 2
Views: 4355
Reputation: 31
SOLVED..conclusion: we must beware of inherited tables.
create table lesComposites of Composite nested table containedInto store as tab5 nested table contains store as tab6;
Upvotes: 1