Re: Setting a DEFAULT value

2001-11-04 Thread Steve Meyers
On Sun, 2001-11-04 at 13:52, Chris Williams wrote: I'm trying to create at table that inserts a default value into a field if nothing is supplied. If in interpret the documentation correctly this should be accomplished by something like this: CREATE TABLE Location (LocationID VARCHAR(10)

RE: Setting a DEFAULT value

2001-11-04 Thread Chris Book
I suggest a few things. First, set it to NOT NULL DEFAULT 1, and then set the value explicitly to null, which will cause it to use the default value. The problem with inserting '' is that its casting to an integer and mysql decides that '' should be 0. Or try using : insert into table (column1,