Re: [sqlite] Error: datatype mismatch (Yanhong Ye)

2012-07-17 Thread Richard Hipp
On Mon, Jul 16, 2012 at 9:29 PM, YAN HONG YE  wrote:

> I know the reason:
> if I change the file encode to latin, it will suecess import the data;
> but when I change the txt file to utf8 encode, It will get the error:
> Error: datatype mismatch
> I wanna know how to import utf8 encode file to my database?
>

Your easiest solution would be to run your script on either Mac or Linux.


>
> >Date: Mon, 16 Jul 2012 02:19:12 -0600
> >From: "Keith Medcalf" 
> >To: "General Discussion of SQLite Database" 
> >Subject: Re: [sqlite] Error: datatype mismatch
> >Message-ID: 
> >Content-Type: text/plain;  charset="us-ascii"
> >
> >
> >sqlite> CREATE TABLE webinfo (inx INTEGER PRIMARY KEY ,website
> varchar(50) UNIQUE,username varchar(50),password varchar(50));
> >sqlite> .mode csv
> >sqlite> .import kk.txt webinfo
> >sqlite> select * from webinfo;
> >0,nytime,gf,a1..7
> >1,bbc,1982,tbth432
> >2,oknic,y...@sohu.com,bbaa1122
> >sqlite>
> >
> >Did you forget to say ".mode csv"?
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error: datatype mismatch (Yanhong Ye)

2012-07-16 Thread YAN HONG YE
I know the reason: 
if I change the file encode to latin, it will suecess import the data;
but when I change the txt file to utf8 encode, It will get the error:
Error: datatype mismatch
I wanna know how to import utf8 encode file to my database?

>Date: Mon, 16 Jul 2012 02:19:12 -0600
>From: "Keith Medcalf" 
>To: "General Discussion of SQLite Database" 
>Subject: Re: [sqlite] Error: datatype mismatch
>Message-ID: 
>Content-Type: text/plain;  charset="us-ascii"
>
>
>sqlite> CREATE TABLE webinfo (inx INTEGER PRIMARY KEY ,website varchar(50) 
>UNIQUE,username varchar(50),password varchar(50));
>sqlite> .mode csv
>sqlite> .import kk.txt webinfo
>sqlite> select * from webinfo;
>0,nytime,gf,a1..7
>1,bbc,1982,tbth432
>2,oknic,y...@sohu.com,bbaa1122
>sqlite>
>
>Did you forget to say ".mode csv"?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users