Subject foreign key strangeness
Author Andrew Gough
Hi All,

I dont know if this is a peculiarity, a known issue, or by design:

I have two tables with a foreign key constraint, as follows:

CREATE TABLE Test1
(
id1 INTEGER NOT NULL,
data1 CHAR(20),
PRIMARY KEY (id1)
);

CREATE TABLE Test2
(
fk2 CHAR(5) NOT NULL,
data2 CHAR(20),
FOREIGN KEY (fk2) REFERENCES Test1 (id1)
);

As you can see, the foreign key is referencing a primary key of a different
data type. When creating these tables, FB does not complain (tested Win2k
FB1.5RC6 & RC7).

The same script in MS SQL fails (as expected).

Andrew Gough
LiveNote Technologies Inc.