magento - Trigger - mysql -


create trigger productstatushistory_3  after update on catalog_product_entity_int each row begin   if (old.value <> new.value)then    insert tbl_product_status_history(entity_id,oldvisible,newvisible,datetime) values(new.entity_id,old.value,new.value,now());   end if; end; 

its not working,

error

#1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 5

you need delimiter

delimiter //  create trigger productstatushistory_3  after update on catalog_product_entity_int each row begin   if (old.value <> new.value)    insert tbl_product_status_history    (entity_id,oldvisible,newvisible,datetime)        values    (      new.entity_id,old.value,new.value,now()     );   end if; end;//  delimiter ; 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -