1

Here is 4 triggers which can be added to mysql table:

  1. before insert
  2. before update
  3. after insert
  4. after update

Suppose that all triggers were added to the table. Then the insert on duplicate executed. What trigger are executed and in what order?

Also insert on duplicate supports column for access column value and VALUES(column) for accessing new inserted value. How do they are mapped to NEW and OLD variables which are used in triggers?

Cherry
  • 31,309
  • 66
  • 224
  • 364

1 Answers1

0

On insert on duplicate update first it will try to inset data and if it fails then update record. always it will execute only one statement inset or update so you can expect either insert triggers or update triggers to be triggered. not all

Mahesh Madushanka
  • 2,902
  • 2
  • 14
  • 28