[sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Tim Streater
If I have a text column defined as it might be as MYCOL TEXT (that is with no default value), is there a way to distinguish in some row or other between a column into which no data has ever been entered, and a column that might have been set to a string, but later set to the empty string? (or

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Donald Griggs
On Mon, Feb 17, 2014 at 6:37 AM, Tim Streater t...@clothears.org.uk wrote: If I have a text column defined as it might be as MYCOL TEXT (that is with no default value), is there a way to distinguish in some row or other between a column into which no data has ever been entered, and a column

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Simon Slavin
On 17 Feb 2014, at 11:37am, Tim Streater t...@clothears.org.uk wrote: If I have a text column defined as it might be as MYCOL TEXT (that is with no default value), is there a way to distinguish in some row or other between a column into which no data has ever been entered, and a column that

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Clemens Ladisch
Tim Streater wrote: If I have a text column defined as it might be as MYCOL TEXT (that is with no default value) All columns have a default value. With no _explicitly_ specified default value, the column's default value is NULL. is there a way to distinguish ... between ... no data ... and

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Tim Streater
On 17 Feb 2014 at 14:10, Simon Slavin slav...@bigfraud.org wrote: On 17 Feb 2014, at 11:37am, Tim Streater t...@clothears.org.uk wrote: If I have a text column defined as it might be as MYCOL TEXT (that is with no default value), is there a way to distinguish in some row or other between a

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Stephan Beal
On Mon, Feb 17, 2014 at 5:57 PM, Tim Streater t...@clothears.org.uk wrote: complete in a browser window, which data is then gathered up and sent using ajax to be processed by a PHP script, which writes it to an sqlite db. The user complains that some of this data doesn't make it, so I want to

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Tim Streater
On 17 Feb 2014 at 17:01, Stephan Beal sgb...@googlemail.com wrote: FWIW, i have seen a similar problem in a legacy app which uses latin1 encoding in the DB. Latin1 doesn't always survive round-trip through PHP's JSON APIs. My case was similar to yours, and we eventually determined that the

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread RSmith
On 2014/02/17 19:01, Stephan Beal wrote: On Mon, Feb 17, 2014 at 5:57 PM, Tim Streater t...@clothears.org.uk wrote: complete in a browser window, which data is then gathered up and sent using ajax to be processed by a PHP script, which writes it to an sqlite db. The user complains that some

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread RSmith
Forgot to add: My headache was essentially UTF-8 encoding, but the same would happen with others, though invalid chars do not really exist in UTF7 or ANSI, but in the higher level encodings they are plentiful. On 2014/02/17 19:35, RSmith wrote: Yeah, I too have had real problems with this -

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Simon Slavin
On 17 Feb 2014, at 4:57pm, Tim Streater t...@clothears.org.uk wrote: Thanks. I should perhaps have made it clearer that I'm looking at an issue a user has. The application gathers some data from the user via a set of fields they complete in a browser window, which data is then gathered up

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Tim Streater
On 17 Feb 2014 at 18:38, Simon Slavin slav...@bigfraud.org wrote: On 17 Feb 2014, at 4:57pm, Tim Streater t...@clothears.org.uk wrote: Thanks. I should perhaps have made it clearer that I'm looking at an issue a user has. The application gathers some data from the user via a set of fields

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Simon Slavin
On 17 Feb 2014, at 7:08pm, Tim Streater t...@clothears.org.uk wrote: Yes. I'm concluding that there's something fishy with the way my data-gathering page is operating. I've recently added use strict; to my javascript and that may be exposing something. My web apps involve a hand-off