This question is an exact duplicate:
- SQL Trigger Error 1 Response
There is a trigger:
DELIMITER // create trigger betdesk_db.after_update_confirm after update on pre_Accounts for each row begin insert into Accounts(mail, `password`, solt, role_id) values (NEW.mail, NEW.password, NEW.solt, 2); delete from pre_Accounts where NEW.pre_account_id = pre_account_id; end; // DELIMITER ; The meaning is that when updating data in the pre_Accounts table, they are transferred to the Accounts table and deleted. However, an error occurs when updating data:
update pre_Accounts set confirm = true where pre_account_id = 1; Data is not updated due to the following error:
Error Code: 1442. Can't update table
Where was I wrong, tell me ..