1
I have a problem in a Rigger that when I do an input of a record I want to automatically pass a value that comes by default is 1 to 0 only it is always giving this error.
Can’t update table 'receipts' in stored Function/Trigger because it is already used by statement which Invoked this stored Function/Trigger.
Trigger
CREATE TRIGGER actrecibo AFTER INSERT on Recibos
FOR EACH ROW
BEGIN
UPDATE recibos set is_new = 0 WHERE id = NEW.id;
END
Someone knows how to look for this to happen and how I can fix it ?
According to that answer you’re not allowed to do that. http://stackoverflow.com/questions/11247590/mysql-trigger-set-values-for-new-row-and-update-ther-in-the-sametable
– Reginaldo Rigo