Ich versuche, diese Transaktion auf MariaDB 10.1.25 auf Fedora 25 und DBeaver als SQL-Editor durchzuführen.Fehler bei MariaDB Transaktionsversuch
Jede Abfrage allein funktioniert gut, aber wenn sie auf den Transaktionsblock umbrechen, schlägt immer fehl.
BEGIN;
INSERT INTO quality.tb_account (email, password, registration_date, active, screen_name)
VALUES ('[email protected]', 'password', CURRENT_DATE(), TRUE, 'user11');
INSERT INTO quality.tb_account_roles (account_id, role_id)
VALUES (LAST_INSERT_ID(), 1);
COMMIT;
Der Fehler ist der nächste:
SQL Error [1064] [42000]: (conn:2) 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 quality.tb_account (email, password, registration_date, active, scre' at line 2
Query is : BEGIN;
INSERT INTO quality.tb_account (email, password, registration_date, active, screen_name) VALUES ('[email protected]', 'password', CURRENT_DATE(), TRUE, 'user11');
INSERT INTO quality.tb_account_roles (account_id, role_id) VALUES (LAST_INSERT_ID(), 1);
COMMIT
(conn:2) 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 quality.tb_account (email, password, registration_date, active, scre' at line 2
Query is : BEGIN;
INSERT INTO quality.tb_account (email, password, registration_date, active, screen_name) VALUES ('[email protected]', 'password', CURRENT_DATE(), TRUE, 'user11');
INSERT INTO quality.tb_account_roles (account_id, role_id) VALUES (LAST_INSERT_ID(), 1);
COMMIT
org.mariadb.jdbc.internal.util.dao.QueryException: 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 quality.tb_account (email, password, registration_date, active, scre' at line 2
Query is : BEGIN;
INSERT INTO quality.tb_account (email, password, registration_date, active, screen_name) VALUES ('[email protected]', 'password', CURRENT_DATE(), TRUE, 'user11');
INSERT INTO quality.tb_account_roles (account_id, role_id) VALUES (LAST_INSERT_ID(), 1);
COMMIT
Was mache ich falsch ?? Warum funktioniert jede Abfrage alleine, aber nicht zusammen?
danke für die hilfe !! – rojoherrero