【问题标题】:sqlite3 gives no such table errorsqlite3 没有给出这样的表错误
【发布时间】:2011-08-29 15:55:44
【问题描述】:

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

create table data1 (id integer, city text, bank text, address text);
.separator ","
.import atm_list_india_updated.csv data1

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

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> 

【问题讨论】:

标签: csv sqlite


【解决方案1】:

与 SQLite shell 内置命令的其他点命令一样,.import 命令不应以分号结尾。

【讨论】:

  • 老兄,谢谢你,我以为我快疯了。我一直把 ;最后!
【解决方案2】:

这样做有帮助:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-10
    相关资源
    最近更新 更多