CREATE TRIGGER google_inventory BEFORE UPDATE ON `cataloginventory_stock_item`
FOR EACH ROW
BEGIN
update `catalog_product_entity_int`
set value=20
where attribute_id=552
and entity_id=NEW.product_id
and NEW.is_in_stock=0;
update `catalog_product_entity_int`
set value=21
where attribute_id=552
and entity_id=NEW.product_id
and NEW.is_in_stock=1;
END;
Es mir folgende Fehler gibt:Was ist mit diesem mysql falsch erstellen Trigger Anweisung
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4
ich einen SQL Server Typen durch Handel bin und kann meinen Finger nicht anziehen, was das Problem ist.
was NEW.product_id und NEW.is_in_stock? ist es von einer anderen Tabelle, wenn ja, dann müssen Sie sich daran anschließen – Taryn
Neu ist die Triggersyntax, die sich auf die Änderungen bezieht, die in der Tabelle gemäß diesem Dokument gemacht werden http://dev.mysql.com/doc/refman /5.0/de/create-trigger.html – RThomas