D2K - Re-defining foreign keys?

From: Andy Hardy <Andy_Hardy_at_camk.demon.co.uk>
Date: 1997/10/17
Message-ID: <Y2r4CAADL2R0Mwx6_at_camk.demon.co.uk>#1/1


[Quoted] I have a query regarding re-mapping foreign keys between the entities and the tables.

I'm trying to create a relationship showing that a mixed_material consists of two other materials. Each material must exist within the materials table.

For example: mixed_material 'concrete' consists of materials 'cement' and 'gravel'. All three materials are to exist within the materials table.

I want to be able to look at a list of materials and 'summarise' them into the least number of materials that can be produced from that list.

I have two tables:

materials

        R_ID (PK)
        DESCRIPTION

mixed_materials
        SR_ID (PK)
        material1 (FK to materials.R_ID)
        material2 (FK to materials.R_ID)
        resultant_material (FK to materials.R_ID)

which is shown as mixed_materials with three many-to-one relationships with materials.

I am having trouble getting D2K to map the foreign keys on the resultant tables - I don't see how to do this in the 'create database wizard' and so alter the tables foreign keys once they have been generated (by adding the correct key components and deleting the columns D2K added for the FKs). If I then generate and run the resultant .SQL I see that the index created for these re-mapped keys contains a blank entry and so is not generated.

Am I following the wrong modeling approach?

Am I using D2K incorrectly?

-- 
Andy Hardy
Senior IT Systems Engineer
Cegelec AEG
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions are mine and do not necessarily reflect those of Cegelec AEG
Received on Fri Oct 17 1997 - 00:00:00 CEST

Original text of this message