Is it possible to fire a mysql trigger for both the insert and update events of a table?
I know I can do the following
CREATE TRIGGER my_trigger
AFTER INSERT ON `table`
FOR EACH ROW
BEGIN
.....
END //
CREATE TRIGGER my_trigger
AFTER UPDATE ON `table`
FOR EACH ROW
BEGIN
.....
END //
But how can I do
CREATE TRIGGER my_trigger
AFTER INSERT ON `table` AND
AFTER UPDATE ON `table`
FOR EACH ROW
BEGIN
.....
Is it possible, or do I have to use 2 triggers? The code is the same for both and I don't want to repeat it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…