Run multiple commands in sqlite manager

↘锁芯ラ 提交于 2019-12-19 09:47:04

问题


It's possible to run more than one command in the direct SQL execution in SQlite Manager? (useful if you insert a lot of data)

e.g.

insert into TestTable (Name, Age) values("Thomas", 25)
insert into TestTable (Name, Age) values("Peter", 29)
...

Thx


回答1:


Solution is very simple ;-)

-> use a semicolon to separate the commands

insert into TestTable (Name, Age) values("Thomas", 25);
insert into TestTable (Name, Age) values("Peter", 29);
...



回答2:


Alternatively, you could write the statement as:

insert into TestTable (Name, Age) 
values
("Thomas", 25),
("Peter", 29)
;

Edit: Please note, as per @DominiqueJacquel's comment, that this will only work in SQLite version 3.7.11+



来源:https://stackoverflow.com/questions/12741891/run-multiple-commands-in-sqlite-manager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!