How can I import a CSV file into an SQLite table that doesn't allow null values?

Posted by Philip on Super User See other posts from Super User or by Philip
Published on 2010-12-28T14:35:32Z Indexed on 2010/12/28 14:57 UTC
Read the original article Hit count: 196

Filed under:
|
|
|
|

I've been using the SQLite Manager extension for Firefox to edit my Chrome web data file in order to restore my keyword searches, and I think I have everything in place except that when I import a CSV file into a table,
(a) it won't import into the actual table because the table doesn't allow null values
(b) if I import it into a new table that does allow null values, then all the empty strings end up as null and I have to manually edit the row, type and delete a character, and then it's set to empty string and it's fine

So: is there either a way to import the CSV so that empty cells are automatically turned into empty strings instead of null, OR is there a way once a table is imported that has null values to convert it into one that doesn't allow null values, where each formerly null value is the empty string?

Thanks!

© Super User or respective owner

Related posts about database

Related posts about import