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.
-
Does SQLite also use those dreaded backticks?user1822– user18222014年12月18日 19:54:27 +00:00Commented Dec 18, 2014 at 19:54
-
If it doesn't, I don't see why not.Agi Hammerthief– Agi Hammerthief2014年12月18日 19:56:03 +00:00Commented Dec 18, 2014 at 19:56
-
@a_horse_with_no_name Only for compatibility with MySQL.CL.– CL.2014年12月19日 11:12:22 +00:00Commented Dec 19, 2014 at 11:12
1 Answer 1
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.