Update on another line on the same table by Trigger

1

Is there any way to do an update in the same table, in another line, by after insert or before insert ?

    
asked by anonymous 10.10.2014 / 15:06

1 answer

1

According to this Stackoverflow response , what you want is not possible in MySql. Excerpt from documentation :

  

A stored function or trigger can not modify a table that is already   being used (for reading or writing) by the statement that invoked the   function or trigger.

A suggested alternative in the same answer is to create a stored procedure that does the action of trigger plus update next to a transaction .

    
10.10.2014 / 15:13