Is the DEFAULT value for a column suppose to replace
an explicit NULL value?  Or does the DEFAULT value only
get used if no values for an insert is specified?  What
is the correct SQL behavior?

SQLite does the latter - the DEFAULT value is only used
if no value is given for the column.  If you insert an
explicit NULL value then a NULL value is inserted instead
of the DEFAULT value.  Ticket #1705 says this is
incorrect.

FWIW, MS SQL Server 2000 does it the same way as SQLite. Specifically inserting a null results in a null in the table, unless there is a 'not null' constraint on the field, of course, in which case inserting a null generates an error.

Reply via email to