MySQL Trigger: Can I use Update? -



MySQL Trigger: Can I use Update? -

create trigger history before update on bestbuy each row begin if new.saleprice <> old.saleprice insert history_price (modelnumber,saleprice) values (old.modelnumber,old.saleprice); elseif new.saleprice = old.saleprice set new.saleprice = old.saleprice; end if; end

my question: valid utilize

create trigger history before replace on bestbuy

no, not - valid events insert, update , delete.

are sure updating info replace? - alter that, update insert ... on duplicate key update - trigger run

edit address comments

take @ insert ... on duplicate key update syntax on mysql site - it's ordinary insert, clause in - think improve performer replace, because not delete record insert again, updates values

mysql triggers

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -