当前位置: 代码迷 >> 其他数据库 >> sqlite3中怎么导入数据
  详细解决方案

sqlite3中怎么导入数据

热度:5223   发布时间:2013-02-26 00:00:00.0
sqlite3中如何导入数据
在linux系统下
sqlite3 dbname "sql" > 1.txt
这样,可以将查询的内容导入到1.txt

现在我想将1.txt导入到另一个db的表里,表结构与导出的一致。
请问一下,如何操作??谢谢。

------解决方案--------------------------------------------------------
sqlite> .import 1.txt tt
------解决方案--------------------------------------------------------
引用For simple CSV files, you can use the SQLite shell to import the file into your SQLite database. First create the table, then designate the separator, and finally import the file.


sqlite> create table test (id integer, datatype_id integer, level integer, meaning text);
sqlite> .separator ","
sqlite> .import no_yes.csv test
Unfortunately, not all CSV files are simple. For instance, the CSV line


"Last, First", 1234