Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-06 Thread Dennis Cote
[EMAIL PROTECTED] wrote: Dennis Cote <[EMAIL PROTECTED]> wrote: It is worth noting that SQLite's behavior is not completely consistent. If the column is declared to be an 'integer primary key', then SQLite will insert a "default" value even when the user explicitly supplies a NULL value in

Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-06 Thread Jay Sprenkle
On 3/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Dennis Cote <[EMAIL PROTECTED]> wrote: > > > > It is worth noting that SQLite's behavior is not completely consistent. > > If the column is declared to be an 'integer primary key', then SQLite > > will insert a "default" value even when the

Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-06 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: > > It is worth noting that SQLite's behavior is not completely consistent. > If the column is declared to be an 'integer primary key', then SQLite > will insert a "default" value even when the user explicitly supplies a > NULL value in an insert statement

Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-06 Thread Dennis Cote
Thomas Chust wrote: 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

Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-04 Thread Kurt Welgehausen
The current implementation is correct. According to the '92 std (remembering that the default default value of a column is null) the procedure for constructing a new row is (conceptually) 1. Construct a row containing the default value for each column. 2. For each column value specified i

Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-03 Thread Firman Wandayandi
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

Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-03 Thread Thomas Chust
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

Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-03 Thread Brad
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

Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-03 Thread Jay Sprenkle
> 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

Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-03 Thread Jay Sprenkle
Default is only supposed to apply on insert, and if no value is specified. If you explicitly insert a null it should be null, not the default. On 3/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is the DEFAULT value for a column suppose to replace > an explicit NULL value? Or does the DEFA

Re: [sqlite] DEFAULT values replace explicit NULLs?

2006-03-03 Thread Derrell . Lipman
[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 va

[sqlite] DEFAULT values replace explicit NULLs?

2006-03-03 Thread drh
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 ins