Re: [sqlite] SELECT on empty fields ??

2006-11-28 Thread Marten Feldtmann
There are good reasons to have "NULL" values - though they can make the live a bit harder. Use them - even Microsoft has found out, that they made a big mistake in .NET 1.x and corrected them in 2.0 by introducing nullable types. Darren Duncan schrieb: You can save your self a lot of grief by

RE: [sqlite] SELECT on empty fields ??

2006-11-27 Thread Fred Williams
vember 27, 2006 6:51 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] SELECT on empty fields ?? > > > At 5:36 PM -0600 11/27/06, Jay Sprenkle wrote: > >On 11/27/06, Isaac Raway <[EMAIL PROTECTED]> wrote: > >>I'd like to strongly second this. Avoid NULL

Re: [sqlite] SELECT on empty fields ??

2006-11-27 Thread Darren Duncan
At 5:36 PM -0600 11/27/06, Jay Sprenkle wrote: On 11/27/06, Isaac Raway <[EMAIL PROTECTED]> wrote: I'd like to strongly second this. Avoid NULL columns, even at apparent cost. Having a valid default value is always better. If a design appears to require NULL values, then the design is likely

Re: [sqlite] SELECT on empty fields ??

2006-11-27 Thread Isaac Raway
In my experience, NULL has been used by inexperienced developers to great detriment to the stability of their projects. Please note my use of the word "likely" and the definition of the given word. In a large portion of cases there is no reason that there would be a "missing" or "unknown" value.

Re: [sqlite] SELECT on empty fields ??

2006-11-27 Thread Jay Sprenkle
On 11/27/06, Isaac Raway <[EMAIL PROTECTED]> wrote: I'd like to strongly second this. Avoid NULL columns, even at apparent cost. Having a valid default value is always better. If a design appears to require NULL values, then the design is likely critically flawed. Using NULLS is NOT a critical

RE: [sqlite] SELECT on empty fields ??

2006-11-27 Thread Robert Simpson
> -Original Message- > From: Isaac Raway [mailto:[EMAIL PROTECTED] > Sent: Monday, November 27, 2006 7:05 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] SELECT on empty fields ?? > > I'd like to strongly second this. Avoid NULL columns, even at apparent >

Re: [sqlite] SELECT on empty fields ??

2006-11-27 Thread Isaac Raway
I'd like to strongly second this. Avoid NULL columns, even at apparent cost. Having a valid default value is always better. If a design appears to require NULL values, then the design is likely critically flawed. For something this simple, a default '' string would be much better. On 11/26/06,

Re: [sqlite] SELECT on empty fields ??

2006-11-26 Thread Darren Duncan
You can save your self a lot of grief by declaring all of your fields to be NOT NULL and default the text fields to the empty string, ''. Use '' rather than NULL when you don't have a name. Then you can simply say "where foo=''". -- Darren Duncan At 10:52 PM +0100 11/26/06, Daniel Schumann

RE: [sqlite] SELECT on empty fields ??

2006-11-26 Thread Robert Simpson
NULL is not equal to anything, including itself. ('' = NULL) is false, (NULL = NULL) is also false. To test for NULL, use IS NULL, such as : SELECT * FROM t WHERE (LastName = '' OR LastName IS NULL) AND (Name = 'Peter') -Original Message- From: Daniel Schumann [mailto:[EMAIL