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

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -