Does the sqlite3 .import command used to import data from delimited text files append rows to existing content if the destination table is not empty, or does it clear the table first?
views:
141answers:
2
+2
A:
.import appends rows to existing data (if any), it does not overwrite the contents of the table.
$ echo "d|e|f" > testimport.txt
sqlite> create table testimport (col1, col2, col3);
sqlite> insert into testimport(col1,col2,col3) values ('a','b','c');
sqlite> select * from testimport;
a|b|c
sqlite> .import testimport.txt testimport
sqlite> select * from testimport;
a|b|c
d|e|f
Louis
2009-10-23 18:07:51