Hi,
I have two tables
TABLE 1
table1_id - primary key
nice_desc
TABLE2
table2_id - primary key
nice_desc
Now, customer wants to ensure that values entered into the table2 column for nice_desc already exist in the TABLE1.
This isn't the seti I would like to have here .. was already implemented. I would like to have just zapped the nice_desc column from table2 and put table1_id there instead and then made table2.table1_id a foreign key. But I'm stuck .. this is an issue that extends the entire model.
I quess my question is .. is there any way to enforce referentical integrity and prevent redundancy without using triggers?? Or foreign keys? I don't think there is ..
I'm working on DB2. Have tried the check constraint way .. but don't think this is an option.
ALTER TABLE table1 ADD CONSTRAINT "table1_ch3"
CHECK (column in (select column from table2))
;
Any DB2 gurus out there?? Although I don't think that there is any nice solution to this .. other than redesign.
Thanks