Updating of old row is not allowed in trigger
This is the same as a regular trigger except that the timing of the trigger firing can be adjusted using SET CONSTRAINTS. They can be fired either at the end of the statement causing the triggering event, or at the end of the containing transaction; in the latter case they are said to be deferred.A pending deferred-trigger firing can also be forced to happen immediately by using The name to give the new trigger.Both of these reasons are why My SQL prevents you from doing this.However, depending on what you're trying to achieve, you can access the new values by using NEW.fieldname or even the old values--if doing an UPDATE--with OLD.This must be distinct from the name of any other trigger for the same table.The name cannot be schema-qualified — the trigger inherits the schema of its table.– Xtreme Biker Oct 9 '13 at | this answer answered Mar 8 '13 at rsanchez 10.2k 1 18 30 My SQL says: Updating of new row is not allowed in after trigger.:( – Mitesh Mynee Mar 8 '13 at 1 Sorry, you need to change it from AFTER INSERT to BEFORE INSERT, as in Steve's answer – rsanchez Mar 8 '13 at It worked :) Thanks – Mitesh Mynee Mar 8 '13 at | A "BEFORE-INSERT"-trigger is the only way to realize same-table updates on an insert, and is only possible from My SQL 5.5 .
An optional comma-separated list of arguments to be provided to the function when the trigger is executed. Simple names and numeric constants can be written here, too, but they will all be converted to strings. Sign up for a free Git Hub account to open an issue and contact its maintainers and the community.By clicking “Sign up for Git Hub”, you agree to our terms of service and privacy statement.This can lead to constraint violations or stored data that does not honor the referential constraint.The ability to specify multiple actions for a single trigger using If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.