Constraint & 'pseudo' Foreign Keys

From: Noah B. Hart <noah_at_lipman.com>
Date: 1996/10/31
Message-ID: <01bbc75e$670a4480$23a99ecd_at_Redwood.lipman.com>#1/1


I have 3 tables, Profiles, Notes and Addresses

P has the columns SSN, seq, LastName, Firstname N has the columns P_SSN, P_SEQ, ENTRY, etc A has the columns P_SSN, UPDATED, etc

P has the Primary Key SSN, SEQ
N has the Primary Key P_SSN, P_SEQ, ENTRY A has the Primary Key P_SSN, UPDATED

(P has all the family members as sequences under the primary SSN)

N has the Foreign Key constraint,
REFERENCES Profiles (SSN, seq)
since Notes are associated with a specific family member.

The problem:

How to add a constraint to Address, requiring that the field P_SSN exist in Profiles.

I cannot use a Foreign key, since A does not have the p_seq field

IAny Ideas,

-- 
Noah B. Hart
Systems Administrator
Received on Thu Oct 31 1996 - 00:00:00 CET

Original text of this message