Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 23004 invoked from network); 31 Aug 2006 11:48:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Aug 2006 11:48:56 -0000 Received: (qmail 6190 invoked by uid 500); 31 Aug 2006 11:48:54 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 6170 invoked by uid 500); 31 Aug 2006 11:48:54 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 6159 invoked by uid 99); 31 Aug 2006 11:48:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Aug 2006 04:48:54 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.1.36] (HELO gmpea-pix-1.sun.com) (192.18.1.36) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Aug 2006 04:48:53 -0700 Received: from d1-emea-09.sun.com ([192.18.2.119]) by gmpea-pix-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k7VBmWGM002920 for ; Thu, 31 Aug 2006 12:48:32 +0100 (BST) Received: from conversion-daemon.d1-emea-09.sun.com by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0J4V00D011X0LH00@d1-emea-09.sun.com> (original mail from Bernt.Johnsen@Sun.COM) for derby-user@db.apache.org; Thu, 31 Aug 2006 12:48:32 +0100 (BST) Received: from [129.159.112.201] by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0J4V00E3F24VZGIB@d1-emea-09.sun.com> for derby-user@db.apache.org; Thu, 31 Aug 2006 12:48:32 +0100 (BST) Date: Thu, 31 Aug 2006 13:48:26 +0200 From: "Bernt M. Johnsen" Subject: Re: SQL Parser failing on NULL column contraint In-reply-to: <44F6B856.9070503@xtra.co.nz> Sender: Bernt.Johnsen@Sun.COM To: Derby Discussion Reply-to: Bernt.Johnsen@Sun.COM Message-id: <44F6CC8A.50706@Sun.COM> Organization: Sun Microsystems MIME-version: 1.0 Content-type: multipart/signed; boundary=------------enig4C8DEF0E7EE572B2C836F1C9; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Enigmail-Version: 0.94.0.0 References: <44F3087F.1020006@intland.com> <44F34597.4090902@gmail.com> <44F587AA.8060007@xtra.co.nz> <44F5AE95.2010907@amberpoint.com> <44F67DEB.2040103@xtra.co.nz> <44F6B856.9070503@xtra.co.nz> User-Agent: Thunderbird 1.5.0.4 (X11/20060516) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------enig4C8DEF0E7EE572B2C836F1C9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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). --=20 Bernt Marius Johnsen, Database Technology Group, Staff Engineer, Technical Lead Derby/Java DB Sun Microsystems, Trondheim, Norway --------------enig4C8DEF0E7EE572B2C836F1C9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFE9syOlFBD9TXBAPARAjqXAKDEw2ezDKiWutAOMgdsNQ9H35p9lgCgyKng 6f2t80LwBtWD+biL6YFIl7s= =ui2L -----END PGP SIGNATURE----- --------------enig4C8DEF0E7EE572B2C836F1C9--