This discussion is archived
1 Reply Latest reply: Feb 23, 2011 9:49 AM by Zlatko Sirotic RSS

many-to-many relationships between object tables

841947 Newbie
Currently Being Moderated
Hi everyone. I want to know how I can create a many-to-many relationship between object tables. Imagine the tables below:

CREATE TABLE Table1 OF Table1_Type (t1_ID PRIMARY KEY)
OBJECT IDENTIFIER IS PRIMARY KEY ;

CREATE TABLE Table2 OF Table2_Type (t2_ID PRIMARY KEY)
OBJECT IDENTIFIER IS PRIMARY KEY ;


Now I create a third table which has references to tables 1 & 2:


CREATE TABLE Table3 (
Tabel1_ref REF Table1_Type REFERENCES Table1,
Tabel2_ref REF Table2_Type REFERENCES Table2)


First of all, is this approach correct? If so, what should I consider as the primary key of Table3? It seems that REF types are not acceptable in a primary key constraint.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points