On Fri, 03 Jul 2009 11:12:26 +0800, Kermit Mei <kermit....@gmail.com> wrote:
>Hello, how can I import an empty value into the database from a file. Using the command line tool to import a csv file, you can't import NULLs. A line like val1,,val3 would translate in val1, empty string, val3 in your table row. >The field may be int or string, if I write "NULL" , then I'll read a >string "NULL" from it. I hope that I can get an empty value (Eg, an >empty string whose size() is zero in Qt). >How can I do ? Note that NULL is not the same as empty string. The empty string case is easy, as show above. Now the NULL case. Assuming 'NULL' is never used as an actual value in the input, you could specify ..,NULL,... in the input file and update the table later, like this: UPDATE mytable SET col2 = NULL WHERE col2 = 'NULL'; >Thanks. > >Kermit -- ( Kees Nuyt ) c[_] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users