Collection consisting of another collection? [message #38074] |
Mon, 18 March 2002 04:37 |
Mats
Messages: 2 Registered: March 2002
|
Junior Member |
|
|
Hello.
I'm trying to create a collection that consist of another collection.
Is it possible?
I have tried two ways:
1. To create a record1 and a table1 where table1 then is used in record2 and table2.
It is not allowed.
2. To create an object1 and include it a varray1 where varray1 is used in object2 and varray2 (see below).
It is not allowed.
CREATE OR REPLACE TYPE XXHB_Statement AS OBJECT (
type_name varchar2(100),
short_description varchar2(2000),
description varchar2(32767)
);
CREATE OR REPLACE TYPE XXHB_Statement_Varray AS VARRAY(100) OF XXHB_Statement;
CREATE OR REPLACE TYPE XXHB_Solution AS OBJECT (
id number(15),
score number(15),
type_id number(15),
type_name varchar2(100),
name varchar2(1000),
description varchar2(1000),
statements XXHB_Statement_Varray
);
CREATE OR REPLACE TYPE XXHB_Solution_Varray AS VARRAY(100) OF XXHB_Solution;
|
|
|
Re: Collection consisting of another collection? [message #38075 is a reply to message #38074] |
Mon, 18 March 2002 05:03 |
pratap kumar tripathy
Messages: 660 Registered: January 2002
|
Senior Member |
|
|
sorry , u r not allowed to do that as "Oracle8 and Oracle8i supported only one level of nesting for collections", but u can do the same in 9i.
if u try to do so u will end up with error
Error: PLS-535
Text: A VARRAY type may not contain a NESTED TABLE, VARRAY or LOB
---------------------------------------------------------------------------
Cause: An attempt was made to do one of the following: define a VARRAY type containing a nested collection type or LOB or define a VARRAY type of an object type that has a nested attribute which is one of NESTED TABLE, VARRAY or LOB type.
Action: Check the VARRAY definitions to be sure that they do not contain nested colection types, LOBs or nested attributes.
|
|
|