insert multiple rows at a time in an SQLite database
MySQL example:
INSERT INTO 'tablename' ('column1', 'column2') VALUES
('data1', 'data2'),
('data3', 'data4'),
('data5', 'data6'),
('data7', 'data8');
This can be recast into SQLite as:
INSERT INTO 'tablename'
SELECT 'data1' AS 'column1', 'data2' AS 'column2'
UNION SELECT 'data3', 'data4'
UNION SELECT 'data5', 'data6'
UNION SELECT 'data7', 'data8'
http://hangaebal.blogspot.kr/2014/06/web-sql.html
http://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-time-in-an-sqlite-database
MySQL example:
INSERT INTO 'tablename' ('column1', 'column2') VALUES
('data1', 'data2'),
('data3', 'data4'),
('data5', 'data6'),
('data7', 'data8');
This can be recast into SQLite as:
INSERT INTO 'tablename'
SELECT 'data1' AS 'column1', 'data2' AS 'column2'
UNION SELECT 'data3', 'data4'
UNION SELECT 'data5', 'data6'
UNION SELECT 'data7', 'data8'
http://hangaebal.blogspot.kr/2014/06/web-sql.html
http://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-time-in-an-sqlite-database
'Blogger 이사' 카테고리의 다른 글
[JavaScript] key, value Array Sort (0) | 2016.01.14 |
---|---|
[Javascript] key value Array (0) | 2016.01.14 |
[jQuery] jQuery 이벤트 호출 (0) | 2016.01.14 |
[Javascript] window.load vs document.ready (0) | 2016.01.14 |
[SQLite] Web SQL INSERT OR ... (0) | 2016.01.14 |