SQLite Error – SQL Error or Missing Database Near Comma

bulk-insertsqlite

I'm using DBeaver (because Base only works on OS X) to work with an SQLite database. When I attempt to execute the following query, I get the error message 'SQL error or missing database (near ",": syntax error)', even though I've specified the database and table:

INSERT INTO `contacts`.`contacts` (`fname`, `sname`, `dob`) VALUES ('MTN', 'Account', NULL), ('A', 'Person', -20456000), ('Local', 'Police', NULL), ...;

contacts is the database, containing a table named contacts with the following structure:

CREATE TABLE `contacts` (
    `cid` INTEGER NOT NULL AUTO_INCREMENT,
    `fname` TEXT NULL,
    `sname` TEXT NOT NULL,
    `dob` INTEGER NULL
);

I can use the + button to insert rows, but I'd prefer to perform bulk inserts.

I've already looked at the SQLite INSERT documentation and it looks exactly the same as MySQL's, so I don't see why it's having a hissy fit.

Best Answer

SQLite allows to insert multiple rows with one statment, but only in version 3.7.11 or later.

Apparently, your JDBC SQLite driver is several years out of date.