Good day. Tell me what's wrong with my trigger.

CREATE TRIGGER t_ins_name BEFORE INSERT ON ecity FOR EACH ROW UPDATE ecity SET name = UPPER (NEW. name )

it causes error 1442

    1 answer 1

    You are trying to set a trigger that updates the entire table, for which it is assigned. As a result of its execution, an infinite tree of calls will be created (each update inside the trigger will trigger another update of the entire table, and for each affected entry, it will be necessary to call the trigger again), which MySQL does not allow to do.

    EMNIP triggers do not have the right to work with the table on which they are installed.