You have to change the delimiter you use, otherwise MySQL treats the ;
as the end of the line and processes the commands. When I tried to
run your trigger (with the standard delimiter of ;) I got:
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to
Hi all!
server version: 5.0.18
I attempted to create a trigger with statement and update, it does like
this:
CREATE TRIGGER update_trans AFTER UPDATE ON main_trans
FOR EACH ROW
BEGIN
IF OLD.trans_status='INITIAL' and OLD.trans_state='INITIAL' THEN
update trans set trans_status=NEW.trans_status,