Subject RE: [firebird-support] Foreign keys and column counts
Author Rick DeBay
I mistyped, this should have been:
FOREIGN KEY (column1,column2,Y) REFERENCES

Is something like this possible, or do I need to create a junk column in
order to make the foreign key work?

-----Original Message-----
From: Rick DeBay
Sent: Thursday, July 29, 2004 9:57 AM
Subject: [firebird-support] Foreign keys and column counts

I have a table TABLE1 with a three column primary key; one of the three
columns is constrained to two possible values, X or Y. I have another
table TABLE2 that references rows in TABLE1 with two of the three
primary keys, since it is understood that it always references Y rows.
I'd like to create a foreign key from TABLE2 to TABLE1, but I can't
since the column count is different. What I need is something like:

FOREIGN KEY (column1,column2,Y) REFERENCES TABLE2(primarykey)

I know I could create a column on TABLE2 that defaults to the value Y
but that doesn't seem sensible.

Rick DeBay
Senior Software Developer

Yahoo! Groups Links