db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: SQL Parser failing on NULL column contraint
Date Thu, 31 Aug 2006 11:48:26 GMT
Duncan Groenewald wrote:
> Point 5 is the reason,  one of the databases I use does not handle no
> definition and requires a NULL or  NOT NULL definition.  But its been a
> long time since I checked this so the newer version may be more
> compliant.  I'll check before I waste any more time on this.
>
> Interestingly derby is the first database I have encountered(I think)
> that throws an error on a NULL definition.

I did a brief survey on the net, and found that MySQL, Sybase,
PostgreSQL, HSQLDB, H2, Oracle and SQLServer allows the user to
specify the non-standard "constraint" NULL. PostgreSQL has the most
sensible note in the docs:

"This clause is only available for compatibility with non-standard SQL
databases. Its use is discouraged in new applications."

DB2 and Derby does not allow NULL.

And Sybase defaults to NOT NULL (in default configuration and as you
point out in another mail) which is definitely against the SQL
standard, and that means that portable CREATE TABLE statements will
not work on Sybase (even if they do syntactically).

And, you can't write SQL which is compatible between Sybase (in
default configuration) and Derby (or DB2 for that matter).

-- 
Bernt Marius Johnsen, Database Technology Group,
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway


Mime
View raw message