Sqlite3 does not give such a table error

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

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

Can someone 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> 
+6
source share
2 answers

That helped:

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

Like other dotted commands, which are built-in SQLite shell commands, the .import command .import not end with a semicolon.

+14
source

Source: https://habr.com/ru/post/896134/


All Articles