Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Oracle 8, OO database, N:M relation
Hello,
I have problem with design of object-oriented database in Oracle 8.
I did not find out, how to create N:M relation of two object tables
( let's say tables TABLE1, TABLE2 ).
Object tables are created from object types ( TYPE1, TYPE2 ):
create TABLE1 of TYPE1;
create TABLE2 of TYPE2;
Relations are made by REF attributes in object types ( REF12 attribute - nested table of TYPE1, that uses OIDs to point to objects of TYPE2, similar REF21 attribute - nested table of TYPE2, that uses OIDs to point to objects of TYPE1).
create type REF12 as table of ref TYPE2; create type REF21 as table of ref TYPE1;
create TYPE1 as object(
...
REF12 ref TYPE2;
...
); create TYPE2 as object(
...
REF21 ref TYPE1
...
); The problem is: I can not create REF12, because TYPE2 is not created I can not create TYPE2, beacuse REF21 is not created I can not create REF21, beacuse TYPE1 is not created I can not create TYPE1, because REF12 is not created
Other facts:
- I can not alter object type to add REF12
- I can not alter object table to add REF12 after definition TYPE2
I found some examples ( in Oracle Magazine, November/December 1997) of object-oriented database design, but there were just relations 1:N - there is no problem.
Can somebody give me an advice? I need it very much.
Thank you.
Richard Lesko Received on Fri Mar 06 1998 - 00:00:00 CST