Paul G. Weiss wrote:

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]





Teradata supports DEFAULT <value> syntax. And yes, if you omit the column during an INSERT, the specified value is applied.

Dean Arnold
Presicient Corp.




Reply via email to