Fred Williams wrote:


Don't mean to split hairs, but...

For the following, the "," is the field delimiter and '"' is the string
delimiter.

Although this may fly in the face of reality, an empty string should be
denoted with ,"", and a null value by ,,.  Who is to say whether ,,
denotes an empty string or an unknown value?  ,"", specifically denotes
an empty (zero length) string, where ,, truly indicates an unknown
value.

With current thinking, is the ,, string zero length or unknown?
Following current logic a numeric input value of ,, should be
interpreted as zero (0) not a null value.  An unknown value is not equal
to zero, here in Texas when playing Texas Hold-em!  Otherwise I would
win every hand :-)

Fred,

You are using two different separator characters. The current sqlite shell does not do this, it uses a single separator string. All the input fields are also strings (i.e. there are no numbers until sqlite tries to store the string and looks at the columns affinity). It views an input line as a sequence of strings like this:

  line = input (separator input)*

If you use a comma as your separator, then any quotes that are on the line are part of the input strings, not delimiters for the input strings.

You are assuming that the sqlite shell works like a real CSV reader when it doesn't (it's not very smart). Now, if you were to fix the import command so that it correctly handled CSV data (including commas and quotes in quoted strings) that would also be a good enhancement to sqlite. You should also submit a patch if you do this.

Dennis Cote

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

Reply via email to