MySQL works just as you describe.
-P

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
        )

and if so, under what circumstances is the default applied?

I can imagine it meaning that

        INSERT INTO foo (bar, baz) VALUES (1, NULL)

doesn't trigger the DEFAULT, but that

        INSERT INTO foo (bar) VALUES (1)

would.

But I'm just guessing. I'm not aware of any that do that as I've
never looked into it before.

Tim [trying to write a book, it seems]




Reply via email to