On Fri, 3 Mar 2006, [EMAIL PROTECTED] wrote:

[EMAIL PROTECTED] writes:

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.

Which is right?  The current SQLite implementation or
ticket #1705?

I don't know which is "right" but I certainly have a strong preference.  If I
explicitly insert a value into a column, it's because I want *that* value
inserted -- even if the value I insert is NULL.  If I don't insert any value,
then I expect the DEFAULT value, if one is specified for the column to be
inserted in that column.

Derrell


Hello,

I can only second this statement. I would consider it very counterintuitive to have another values inserted instead of the explicitly specified one.

cu,
Thomas

Reply via email to