Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> PL/SQL recursive (forward) declarations
I recently found this information regarding forward type definitions in Oracle:
/* Here is the incomplete type definition */ CREATE TYPE Person_t;
CREATE TYPE Pet_t AS OBJECT (
tag_no INTEGER,
owner_ref REF Person_t,
...the rest of the attributes and methods...
);
/* Now we can complete the type definition we started earlier.*/
CREATE TYPE Person_t AS OBJECT (
name VARCHAR2(512),
favorite_pet REF Pet_t,
...
);
I need to do something very similar to this. I need to create a datatype called Collection that has field, SubCollectionList first created by saying:
create type SubCollectionList;
create type Collection as object ( HEADER XHeader, ATTRIBUTES XAttributes, SUBCOLLECTION_LIST REF SubCollectionList );
so far, so good.
Then when I try to create the SubCollectionList's actual definition:
create type XSubCollectionList as table of XCollection;
When I try to execute this command, I receive the following error:
ORA-06545: PL/SQL: compilation error - compilation aborted ORA-06550: line 0, column 0: PLS-00565: XSUBCOLLECTIONLIST must be completed as a potential REFtarget (object type)
Does anyone know what is going wrong here? Thanks in advance!
Chris
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Dec 04 2000 - 15:29:42 CST