Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sqlite3 gives no such table error

Tags:

sqlite

csv

I am trying to populate a SQLite database from a csv file on Ubuntu 11.04. I ran the following commands:

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

Could anyone tell me what is going wrong? Why am I getting this error?

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> 
like image 744
whatf Avatar asked Aug 29 '11 15:08

whatf


1 Answers

As well as other dot-commands that are SQLite shell builtin commands, the .import command should not terminate with a semicolon.

like image 118
Benoit Avatar answered Nov 10 '22 13:11

Benoit