I now see that if I properly define the field type as VARCHAR instead of
STRING that the CSV is correctly parsed.

-braddock

On Fri, 20 Apr 2012 17:54:04 -0700, Braddock Gaskill
<bradd...@braddock.com> wrote:
> Hi Guys,
> 
> This may be a known issue.  I know sqlite isn't known for it's CSV
> support.
> But it makes CSV .import almost useless for string types, even if you
know
> there will be no embedded commas or other delimiters.
> 
> There is NO SAFE WAY to import string fields using sqlite's .import
> function.
> If the string can be interpreted as an numeric value, even if it
> overflows, it will be turned into an "Inf".
> This is true even when the column type is specified as a string.
> 
> sqlite3 --version
> 3.6.22
> 
> cat <<EOF >data.tab
>> Hello World!
>> 1234e12345
>> EOF
> 
> sqlite3
> sqlite> CREATE TABLE foo (myfield STRING);
> sqlite> .import data.tab foo
> sqlite> select * from foo;
> Hello World!
> Inf
> sqlite>
> 
> Thanks, I love Sqlite!
> 
> -braddock
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to