On 3/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> 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?

IMO the NOTNULL keyword should be a clue for this, if the column has
DEFAULT value and NOTNULL flag that should be inserted of DEFAULT
value if no value is given, if column has no NOTNULL and has DEFAULT
value that should be DEFAULT value is inserted otherwise NULL value is
inserted. If no value given into the NOTNULL column that should be
raised the syntax error.

--
Firman Wandayandi
Never Dreamt Before: http://firman.dotgeek.org/
Wishlist: http://www.amazon.com/gp/registry/1AAN8NZBHW2W9

Reply via email to