Can't make a simple transaction in MariaDB /Dbeaver

I'm trying to execute this

START TRANSACTION;
SELECT * FROM zones;
COMMIT;

Get this error.

SQL Error [1064] [42000]: (conn=1035920) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT * FROM zones;

When trying to execute this

START TRANSACTION;
INSERT INTO zones (name) VALUES ("ZONE 5");
INSERT INTO zones (name) VALUES ("ZONE 6");
INSERT INTO zones (name) VALUES ("ZONE 7");
COMMIT;

Same

SQL Error [1064] [42000]: (conn=1035920) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO zones (name) VALUES ("ZONE 5");

Don't know why this is happening, I've looked for syntax errors, SQL code samples, everywhere.

MariaDB version: 10.3.30-MariaDB Dbeaver version: Version 22.0.4.202205011839 latest.

Upvotes: 0

Views: 3605

Answers (2)

junkai wu
junkai wu

Reputation: 39

I solved this problem using the "Execute sql script" button.

Upvotes: 1

I've been doing some test and seems like there is something related with de RDBMS. Tried to run the query in phpmyadmin and it worked fine.

Thought that it might have something to do with the RDBMS. I was trying to execute the query highlighting the whole statement.

I could run the query in Dbeaver executing line by line.

  1. START TRANSACTION;

  2. Query statements;

  3. COMMIT; or ROLLBACK;

Following this procedure it worked fine. Also learned that you can't execute multiple INSERT INTO statements all at once.

Upvotes: 0

Related Questions