beck03076
beck03076

Reputation: 3308

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...???

Upvotes: 0

Views: 2786

Answers (2)

Willington Cardona
Willington Cardona

Reputation: 1

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".

Upvotes: 0

Mchl
Mchl

Reputation: 62395

No you can't. Only actual, successful INSERTs trigger before/after insert triggers.

Upvotes: 1

Related Questions