Hi,

I have the following data file and sql script. But I get the following
error. I think that I should be able to import the data from from
/dev/stdin. I replace /dev/stdin with an ordinary file and it works.

Could anybody let me know what is the correct way to do so? Thank you very much!

.import /dev/stdin main
Error: /dev/stdin line 1: expected 2 columns of data but found 1


$ cat file.txt
1       eenie
2       meenie
3       miny
4       mo
$cat main.sql
#!/usr/bin/env bash

rm -f main.db
sqlite3 main.db < file.txt <<EOF

create table test (id integer primary key, value text);
.separator "\t"
.import /dev/stdin test

.headers on
.mode column
select * from test;

EOF

-- 
Regards,
Peng
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to