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

Home -> Community -> Usenet -> c.d.o.server -> How to create mutually referencing types ?

How to create mutually referencing types ?

From: Wolfgang May <may_at_informatik.uni-freiburg.de>
Date: 14 Dec 1998 12:54:19 GMT
Message-ID: <7531pr$5eu$1@n.ruf.uni-freiburg.de>


Hi,

how can I create mutually referencing types ?

e.g., cities which belong to a country, and on the other hand, the country has a capital city:

CREATE OR REPLACE TYPE City_Type AS OBJECT  (Name VARCHAR2(35),
  Country REF Country_Type,
  Population NUMBER,
  Coordinates GeoCoord);
/

CREATE OR REPLACE TYPE Country_Type AS OBJECT (Name VARCHAR2(32),
 Code VARCHAR2(4),
 Capital REF City_Type;
 Area NUMBER,
 Population NUMBER);
/
 

??

First defining country_type without the capital attribut, then defining city_type, and then altering country_type by adding the reference to city does not work since my oracle complains that attributes acnnot be altered by ALTER TYPE:

ALTER TYPE Country_Type REPLACE AS OBJECT  (Capital REF City_Type);

FEHLER in Zeile 1:
ORA-22319: Typattributinformationen in ALTER TYPE geaendert [engl: Type attribute information changed in ALTER TYPE]

Wolfgang Received on Mon Dec 14 1998 - 06:54:19 CST

Original text of this message

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