0

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? – a_horse_with_no_name Dec 18 '14 at 19:54
  • If it doesn't, I don't see why not. – Agi Hammerthief Dec 18 '14 at 19:56
  • @a_horse_with_no_name Only for compatibility with MySQL. – CL. Dec 19 '14 at 11:12
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.