MySQL Forums
Forum List  »  MySQL Workbench

Error Code 2014 Commands out of sync; (MySQL WorkBench)
Posted by: David Hernandez
Date: May 20, 2021 02:05PM

Have read 5 posts on error 2014, none related to MySQL Workbench. I only use
MySQL Workbench 8.0. I have tried all kinds of variations from the material
read on the code presented here but still the error prevails. Can't find
documentation on what the correct sequence should be for "Error Code: 2014
Commands out of sync; you can't run this command now". Any clues how to
address error 2014?

Use Sakila;
DELIMITER $$
DROP TRIGGER IF EXISTS Before_Salary_Table_Delete;
CREATE TRIGGER Before_Salary_Table_Delete
BEFORE DELETE
ON salaries FOR EACH ROW;
BEGIN
SET @message = ‘This record was deleted’;
INSERT INTO SalaryLogAudit2(employeeNumber,validFrom,amount,ActionTaken)
VALUES(OLD.employeeNumber,OLD.validFrom,OLD.amount,OLD.ActionTaken);
UPDATE SalaryLogAudit2 SET ActionTaken = @message WHERE employeenumber = OLD.employeeNumber;
END$$
DELIMITER ;

Options: ReplyQuote


Subject
Views
Written By
Posted
Error Code 2014 Commands out of sync; (MySQL WorkBench)
793
May 20, 2021 02:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.