sqlite3没有给出这样的表错误

wha*_*atf 7 csv sqlite

我试图从Ubuntu 11.04上的csv文件填充SQLite数据库.我运行了以下命令:

create table data1 (id integer, city text, bank text, address text);
.separator ","
.import atm_list_india_updated.csv data1
Run Code Online (Sandbox Code Playgroud)

谁能告诉我出了什么问题?为什么我收到此错误?

sqlite> .tables // shows there is a table called data1
    data1
    sqlite> select * from data1
       ...> ;
    sqlite> .import *******.csv data1;
    Error: no such table: data1; // tells there is no table called data1
    sqlite> .show
         echo: off
      explain: off
      headers: off
         mode: list
    nullvalue: ""
       output: stdout
    separator: ","
        stats: off
        width: 
    sqlite> 
Run Code Online (Sandbox Code Playgroud)

Ben*_*oit 19

除了SQLite shell内置命令的其他点命令外,该.import命令不应以分号结束.


wha*_*atf 0

这样做有帮助:

create table main(id int(10), bank varchar(255), city varchar(255), address varchar(500))
.separater ","
.import ****.csv data1;
Run Code Online (Sandbox Code Playgroud)