2012/4/21 Braddock Gaskill <bradd...@braddock.com>:
>
> 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> CREATE TABLE foo (myfield STRING);
sqlite> INSERT INTO foo VALUES ('255e2555');
sqlite> SELECT * FROM foo;
Inf
sqlite> DROP TABLE foo;
sqlite> CREATE TABLE foo (myfield TEXT);
sqlite> INSERT INTO foo VALUES ('255e2555');
sqlite> SELECT * FROM foo;
255e2555
sqlite> CREATE TABLE foo (myfield VARCHAR);
sqlite> INSERT INTO foo VALUES ('255e2555');
sqlite> SELECT * FROM foo;
255e2555
-- 
Kit
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to