I need to create a Trigger that performs an update on column A of table T, as soon as column B of this table is updated. So I believe I need to create an After Update. But from what I understand, it is not possible. When you try to do this, the following error occurs:
16:03:54 UPDATE esms_conta SET valor_sms=0.3 WHERE id= 127 Error Code: 1442. Can't update table 'esms_conta' in stored function/trigger because it is already used by statement which invoked this stored function/trigger. 0.000 sec
Follow my trigger
DELIMITER ;;
CREATE TRIGGER 'e-sms-db'.'esms_conta_AFTER_UPDATE' AFTER UPDATE ON 'esms_conta'
FOR EACH ROW
BEGIN
UPDATE esms_conta SET sms_disponivel = 10 WHERE id = NEW.id;
END ;;
DELIMITER ;