MYSQL : Manual simulation of the triggering event
質問
MYSQL:
I have a table with a AFTER INSERT ON trigger on it.
I have inserted a million rows in the table and the trigger code successfully gets executed and updates 10 other tables.
Now, I have deleted the data from the 10 children tables but the million rows in the parent table is retained.
Can I manually simulate that trigger code for those million records in the parent table to reinsert them in the 10 children tables...???
解決
No you can't. Only actual, successful INSERT
s trigger before/after insert triggers.
他のヒント
You can use the "AFTER INSERT" trigger like an "AFTER UPDATE", then you can make a safe update where you don't harm anything, this way you can re insert the rows.
Don't forget to delete "AFTER UPDATE", and restore de respective "AFTER INSERT".