Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> PL/SQL recursive (forward) declarations

PL/SQL recursive (forward) declarations

From: <christopher.collins_at_gxs.ge.com>
Date: Mon, 04 Dec 2000 21:29:42 GMT
Message-ID: <90h2bq$l93$1@nnrp1.deja.com>

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 REF
target (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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US