Scott,

I'm not ignoring your post. I'm going to respond to DRH's post.

Thanks,

Lee

_____________________________

-----Original Message-----
From: Scott Hess [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 29, 2008 11:54 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] How Does NOT NULL produce NULLs?

That seems unlikely, since NULL wouldn't come out as the string (null)
in any case.  Most likely some higher layer is putting the literal
'(null)' in for you when you insert.  Please post a set of literal
input to sqlite3 which demonstrates the problem.

.nullvalue '[null]'
create table x (
  [description] [varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE,
  [keywords]    [varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE,
  [metadata]    [varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE
);
insert into x values ('', '', '');
insert into x (description) values ('x');

Outputs:
||
x||

Just what I'd expect.

create table y (
  [description] [varchar](255) COLLATE NOCASE,
  [keywords]    [varchar](255) COLLATE NOCASE,
  [metadata]    [varchar](255) COLLATE NOCASE
);
insert into y values ('', '', '');
insert into y (description) values ('x');
select * from y;

Outputs:
||
x|[null]|[null]

Again, just what I'd expect.

This under SQLite version 3.5.4.

-scott


On Tue, Jan 29, 2008 at 10:12 AM, Lee Crain <[EMAIL PROTECTED]> wrote:
> I've created a table with several fields, 3 of which are created using
>  these SQL statements:
>
>  [description] [varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE,
>
>  [keywords]    [varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE,
>
>  [metadata]    [varchar](255) NOT NULL DEFAULT ('') COLLATE NOCASE);
>
>  __________
>
>  Subsequent data insertions of empty strings produce the following data:
>
>  (null)|(null)|(null)
>
>  __________
>
>  It is important in the application this data is associated with to NOT
>  have any NULL fields. To me, an empty string is not a NULL, only an
empty
>  string, an important distinction.
>
>  How can I prevent the insertion of NULLs into these fields and instead
>  replace them with empty strings?
>
>  Lee Crain
>
>
--------------------------------------------------------------------------
---
>  To unsubscribe, send email to [EMAIL PROTECTED]
>
--------------------------------------------------------------------------
---
>
>

--------------------------------------------------------------------------
---
To unsubscribe, send email to [EMAIL PROTECTED]
--------------------------------------------------------------------------
---



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to