> Would that be possible? I need NULL to be considered unique, like it
> is in certain compatability modes.
Sooner or later, I like to get rid of the system properties. Why do
you need this feature, if not for compatibility with another database?
And if for compatibility, why not use the compatibility mode?
Regards,
Thomas
>>> I need NULL to be considered unique
>> Why do you need this feature,
> Because that's the behavior I desire for the given schema.
Any why exactly?
> I use H2 exclusively.
> I was under the impression that all these varying interpretations of
> the SQL spec would be accessible from system properties, or some other
> means of setting them independently of each other.
Many system properties are temporary, and I like to remove them sooner
or later.
Compatibility with other database is important, specially for testing.
However in your case it doesn't sound like the problem is
compatibility. I don't want to bloat the code unnecessarily. H2 should
be standard compliant, but otherwise it should be as simple as
possible.
Regards,
Thomas
Also, there can be only one system property setting per VM. If
multiple applications use H2 at the same time, and the applications
need different values, it would fail. The only option would be to
support the setting using a SQL statement. But I don't want to do that
(again, code bloat).
Regards,
Thomas
Already exists. Just make the foreign key column nullable. No need to
drop foreign key constraint.
CREATE TABLE COLORS (ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, NAME
VARCHAR NOT NULL UNIQUE);
CREATE TABLE THING (NAME VARCHAR NOT NULL PRIMARY KEY, COLOR_ID INT /*
no NOT NULL here */ REFERENCES COLORS(ID));
INSERT INTO THING (NAME) VALUES ('Air');
SELECT * FROM THING;
NAME COLOR_ID
Air null
HTH,
Jesse