> -----Ursprungligt meddelande-----
> Från: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] För Gabor Grothendieck
> Skickat: den 18 april 2010 18:17
> Till: General Discussion of SQLite Database
> Ämne: Re: [sqlite] how to submit a file with sql to sqlite"
> 
> On Sun, Apr 18, 2010 at 12:02 PM, Wensui Liu 
> <liuwen...@gmail.com> wrote:
> > dear listers,
> > i am wondering if there is a way to submit a file with many sql 
> > statements, say several hundred lines,  to sqlite.
> >
> > thanks for your insight.
> 
> C:\tmp2>type a.sql
> create table tab (a,b);
> insert into tab values(1, 2);
> insert into tab values(1, 2);
> select * from tab;
> 
> C:\tmp2>sqlite3 a.db < a.sql
> 1|2
> 1|2

Or
> type a.sql
create table tab (a,b);
insert into tab values(1, 2);
insert into tab values(1, 2);
select * from tab;

> sqlite3
sqlite> select * from tab;
Error: no such table: tab
sqlite> .read a.sql
a|b
1|2
1|2

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

Reply via email to