php - Mysql Trigger not working while updating history table -
i want update history table using below trigger
create trigger `trig_update_transaction` after update on `transaction` each row begin update transaction_history set old.deliverystatus=new.deliverystatus old.alertid=new.alertid; end$$
what problem here?
problem in these lines:
update transaction_history set old.deliverystatus = new.deliverystatus old.alertid=new.alertid;
from mysql documentation: in update trigger, can utilize old.col_name refer columns of row before updated , new.col_name refer columns of row after updated.
a column named old read only. can refer (if have select privilege), not modify it.
for details, refer this
i love read community on this.
php mysql triggers
No comments:
Post a Comment