At 07:54 PM 12/8/2003 -0500, D. Richard Hipp wrote:
3. Related to #2 above, PRIMARY KEY in the list form does not seem to be strict enough on unique when a null value is involved. If I have 3 columns as part of the PRIMARY KEY list and do an insert that fills in 2 of the fields I can repeat the insert and I get duplicate entries. E.g.:
CREATE TABLE User ( Name VARCHAR (40),
UID INTEGER,
DeviceID VARCHAR (64) DEFAULT 'Unknown',
PRIMARY KEY (Name, UID, DeviceID) );
INSERT INTO User (Name,DeviceID) VALUES ('Michael','Test');
INSERT INTO User (Name,DeviceID) VALUES ('Michael','Test');
Gets me two rows with ('Michael',NULL,'Test').

Shouldn't this also make UID an autoincrement? If so, shouldn't the insert listed above cause it to auto inc? Or does it need to be explicitly set to NULL like:
INSERT INTO User (Name,DeviceID) VALUES ('Michael',NULL,'Test');


thanks.
michael



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to