1

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.

asked Dec 18, 2014 at 19:41
3
  • Does SQLite also use those dreaded backticks? Commented Dec 18, 2014 at 19:54
  • If it doesn't, I don't see why not. Commented Dec 18, 2014 at 19:56
  • @a_horse_with_no_name Only for compatibility with MySQL. Commented Dec 19, 2014 at 11:12

1 Answer 1

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.

answered Dec 19, 2014 at 11:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.