Link to home
Start Free TrialLog in
Avatar of mte01
mte01Flag for Lebanon

asked on

FK constraint that can map to 2 PK tables

Hey experts,

 Can I have a foreign key constraint that states that field x in foreign key table a can map to field y in primary key table b OR field z in primary key table c....usually the constraint is only between 1 FK table & 1 PK table (and not 2)...so can the above be done??
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

no.
you need to implement this using a trigger
Avatar of mte01

ASKER

>>angelIII

My problem is that I have an exisitng FK constraint to a PK table, and since I want to use the existing FK table for another purpose, and I don't want to remove the existing constraint, I thought it would be excellant if it could modify this constaint to make it map to 2 PK tables
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

ASKER

>>angelIII

Ahaa...I see...thx for your help!..