DEFAULT clause without NOT NULL?

2004-08-29 Thread Tim Bunce
Do any databases support CREATE TABLE statement with fields having a DEFAULT clause without a NOT NULL? CREATE TABLE foo ( bar INTEGER, baz INTEGER DEFAULT 42 ) and if so, under what circumstances is the default applied? I can imagine it meaning that

Re: DEFAULT clause without NOT NULL?

2004-08-29 Thread Jonathan Leffler
On Sun, 29 Aug 2004 22:26:25 +0100, Tim Bunce [EMAIL PROTECTED] wrote: Do any databases support CREATE TABLE statement with fields having a DEFAULT clause without a NOT NULL? CREATE TABLE foo ( bar INTEGER, baz INTEGER DEFAULT 42 ) Yes. Informix

RE: DEFAULT clause without NOT NULL?

2004-08-29 Thread Andy Hassall
Do any databases support CREATE TABLE statement with fields having a DEFAULT clause without a NOT NULL? Oracle and MySQL do, at least. [EMAIL PROTECTED] src]$ sqlplus test/test SQL*Plus: Release 9.2.0.5.0 - Production on Mon Aug 30 00:13:29 2004 Copyright (c) 1982, 2002, Oracle

Re: DEFAULT clause without NOT NULL?

2004-08-29 Thread Paul G. Weiss
On Sun, 29 Aug 2004 20:50:05 -0700, Darren Duncan [EMAIL PROTECTED] wrote: At 8:09 PM -0700 8/29/04, Jonathan Leffler wrote: Darren Duncan wrote: At 6:53 PM -0400 8/29/04, Paul G. Weiss wrote: MySQL works just as you describe. -P Even so, it is on the MySQL to-do list that such non-standard