Generating tables with relationships in arc and part of primary key, bug?
Date: 1996/06/14
Message-ID: <4proj7$f83_at_hasle.sn.no>#1/1
I have three entites A, B and C. A relates to B and C with an arc and
(B,C)one-to-many(A). Both relationships are part of the UID of A.
Like this:
-- optional relationship
| Part of UID
( arc
< many
B ----|-(-< A >-)-|--- C
B: #B_ID
C: #C_ID
- #A_ID
#B_ID
(or) #C_ID
Hence my primary key on A should be
A_ID NOT NULL B_ID NULL C_ID NULL
This is (probably) not possible for a primary key, but a unique key should solve it?
My actual problem relates to generation of tables from the entities. The Database Design Wizard gives table A with B_ID and C_ID as NULL and part of primary key. The Server Generator gives DDL accordingly but when the DDL is executed the status of B_ID and C_ID go from NULL to NOT NULL, hence making it impossible to enforce a mutually exclusive relationship.
My conclusion is that the Generator/Wizard does not realize the problem with arcs and primary keys.
If so, it's a bug! (IMHO, of course) The Wizard should have generated an unique key instead.
Would it help if the relationships were mandatory?
oli
PS: Des2k 1.2
oracle v7.1
--
Ole Christian Meldahl
"Sailor"
Norwegian High Command, Information Systems
meldahl_at_pvv.unit.no
Received on Fri Jun 14 1996 - 00:00:00 CEST