Need help to insert query using mysql node. I'm getting error:
Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DELIMITER ;;
CREATE TRIGGER t BEFORE INSERT ON gdc
FOR EACH ROW BEGIN
SET ...' at line 1
But when inserted using "phpmyadmin", shows no error.
What am I doing wrong?
[{"id":"aadf71f9.37505","type":"mysql","z":"50a610c6.08a6a","mydb":"a844720c.608d6","name":"","x":1230,"y":400,"wires":[["2c15ffc.d6401"]]},{"id":"2c15ffc.d6401","type":"debug","z":"50a610c6.08a6a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1390,"y":400,"wires":[]},{"id":"ae5aa79c.41a748","type":"template","z":"50a610c6.08a6a","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELIMITER ;; \nCREATE TRIGGER t BEFORE INSERT ON gdc \nFOR EACH ROW BEGIN \nSET NEW.top_die_temp_gdc1 = NEW.top_die_temp_gdc1 / 10; \nSET NEW.bottom_die_temp_gdc1 = NEW.bottom_die_temp_gdc1 / 10; \nSET NEW.top_die_temp_gdc2 = NEW.top_die_temp_gdc2 / 10; \nSET NEW.bottom_die_temp_gdc2 = NEW.bottom_die_temp_gdc2 / 10; \nSET NEW.top_die_temp_gdc3 = NEW.top_die_temp_gdc3 / 10; \nSET NEW.bottom_die_temp_gdc3 = NEW.bottom_die_temp_gdc3 / 10; \nSET NEW.top_die_temp_gdc4 = NEW.top_die_temp_gdc4 / 10; \nSET NEW.bottom_die_temp_gdc4 = NEW.bottom_die_temp_gdc4 / 10; \nSET NEW.top_die_temp_gdc5 = NEW.top_die_temp_gdc5 / 10; \nSET NEW.bottom_die_temp_gdc5 = NEW.bottom_die_temp_gdc5 / 10; \nEND;; \nDELIMITER ;\nINSERT INTO `gdc`(`date`, `time`, `water_temp`, `ci_temp`,`hydraulic_temp`, `top_die_temp_gdc1`, `side_die_temp_gdc1`, `bottom_die_temp_gdc1`,`top_die_temp_gdc2`, `side_die_temp_gdc2`, `bottom_die_temp_gdc2`,`top_die_temp_gdc3`, `side_die_temp_gdc3`, `bottom_die_temp_gdc3`,`top_die_temp_gdc4`, `side_die_temp_gdc4`, `bottom_die_temp_gdc4`,`top_die_temp_gdc5`, `side_die_temp_gdc5`, `bottom_die_temp_gdc5`) \nVALUES ('2021-11-22','14:34','25','29','392','334','33','339','331','37','348','344','42','375','350','34','344','346','33','344')","output":"str","x":1080,"y":400,"wires":[["aadf71f9.37505"]]},{"id":"ffcbb284.e67e6","type":"inject","z":"50a610c6.08a6a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":920,"y":400,"wires":[["ae5aa79c.41a748"]]},{"id":"a844720c.608d6","type":"MySQLdatabase","name":"","host":"127.0.0.1","port":"3306","db":"mts","tz":"","charset":""}]