Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: on ignore
12-18-2012, 06:04 PM #1
- Join Date
- Dec 2005
- Thanked 76 Times in 76 Posts
trigger: after insert into table1
insert ignore into table2
12-19-2012, 12:49 AM #2
I don't know a way to do it.
But one easy way would be to use a Stored Procedure and forget about the trigger.
In the Procedure, you would attempt the INSERT and, if you get an error from it, then do the other operation (e.g, put data into another table).
I think triggers are over-used and stored procedures are under-used, especially with MySQL.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.