Good day, there was a problem: depending on the id of the changed record, you need to call a certain MySQL function, I do a trigger.
Here is the trigger code:
DELIMITER $$ CREATE TRIGGER price_change after update ON `cms_flower`.oc_product BEGIN DECLARE @func varchar(10); SET @func = 'Call ' + NEW.product_id + '(' + NEW.price + ')'; exec(@func); END$$ DELIMITER ; Issues:
You have an error in your SQL syntax; If you’re on the right line, you’ll be able to use your vidar (10); SET @func = 'Call' + NEW.product_id + '(' + NEW.price + ')' 'at line 5
I do not know how to implement, help pzhlst