Hello,
I currently have a flow working that inserts data from a controller device into a MSSQL table. However I need to change it to insert the data into a MySQL table. The flow is a timestamp insert every minute, it reads data from the controller, the data is placed into a msg.object, and then a insert sql query into the appropriate table. Just can't figure out how to get it into a MySQL table. Here is the working flow into MSSQL. Any help would be great.
[{"id":"1017beb5.640331","type":"inject","z":"12ce0a0e.af95c2","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":true,"onceDelay":"60","x":180,"y":540,"wires":[["66e2edf3.d5b204"]]},{"id":"66e2edf3.d5b204","type":"pac-read","z":"12ce0a0e.af95c2","device":"dba83a6d.a23ee8","dataType":"float-table","tagName":"StorageData","tableStartIndex":"","tableLength":"","value":"StorageData","valueType":"msg","topic":"","topicType":"none","name":"","x":340,"y":420,"wires":[["8f2370b3.af78"]]},{"id":"8f2370b3.af78","type":"function","z":"12ce0a0e.af95c2","name":"StorageData","func":"msg.Relay1=msg.StorageData[0];\nmsg.Relay2=msg.StorageData[1];\nmsg.Relay3=msg.StorageData[2];\nmsg.Relay4=msg.StorageData[3];\nmsg.BatteryVolts=msg.StorageData[4];\nmsg.BatteryAmps=msg.StorageData[5];\nmsg.PVVolts=msg.StorageData[6];\nmsg.PVAmps=msg.StorageData[7];\nmsg.LoadVoltage=msg.StorageData[8];\nmsg.LoadAmps=msg.StorageData[9];\nmsg.CurrentChannel1A=msg.StorageData[10];\nmsg.CurrentChannel2A=msg.StorageData[11];\nmsg.CurrentChannel3A=msg.StorageData[12];\nmsg.CurrentChannel4A=msg.StorageData[13];\nmsg.CurrentChannel5A=msg.StorageData[14];\nmsg.CurrentChannel6A=msg.StorageData[15];\nmsg.CurrentChannel7A=msg.StorageData[16];\nmsg.CurrentChannel8A=msg.StorageData[17];\nmsg.CurrentChannel1B=msg.StorageData[18];\nmsg.CurrentChannel2B=msg.StorageData[19];\nmsg.CurrentChannel3B=msg.StorageData[20];\nmsg.CurrentChannel4B=msg.StorageData[21];\nmsg.Voltage1=msg.StorageData[22];\nmsg.Voltage2=msg.StorageData[23];\nmsg.Relay5=msg.StorageData[24];\nmsg.Relay6=msg.StorageData[25];\nmsg.Relay7=msg.StorageData[26];\nmsg.Relay8=msg.StorageData[27];\nmsg.Volt_Battery2=msg.StorageData[28];\nmsg.Amp_Battery2=msg.StorageData[29];\nmsg.Volt_PV2=msg.StorageData[30];\nmsg.Amp_PV2=msg.StorageData[31];\nmsg.Load_Voltage2=msg.StorageData[32];\nmsg.RelayRandom=msg.StorageData[33];\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":520,"wires":[["42d3c795.52aa68"]]},{"id":"42d3c795.52aa68","type":"MSSQL","z":"12ce0a0e.af95c2","mssqlCN":"ecababf4.5b8728","name":"Azure","query":"insert into dbo.OptoData\n([Relay1]\n ,[Relay2]\n ,[Relay3]\n ,[Relay4]\n ,[BatteryVolts]\n ,[BatteryAmps]\n ,[PVVolts]\n ,[PVAmps]\n ,[LoadVoltage]\n ,[LoadAmps]\n ,[CurrentChannel1A]\n ,[CurrentChannel2A]\n ,[CurrentChannel3A]\n ,[CurrentChannel4A]\n ,[CurrentChannel5A]\n ,[CurrentChannel6A]\n ,[CurrentChannel7A]\n ,[CurrentChannel8A]\n ,[CurrentChannel1B]\n ,[CurrentChannel2B]\n ,[CurrentChannel3B]\n ,[CurrentChannel4B]\n ,[Voltage1]\n ,[Voltage2]\n ,[Relay5]\n ,[Relay6]\n ,[Relay7]\n ,[Relay8]\n ,[Volt_Battery2]\n ,[Amp_Battery2]\n ,[Volt_PV2]\n ,[Amp_PV2]\n ,[Load_Voltage2]\n ,[RelayRandom])\n Values\n ({{{Relay1}}}\n ,{{{Relay2}}}\n ,{{{Relay3}}}\n ,{{{Relay4}}}\n ,{{{BatteryVolts}}}\n ,{{{BatteryAmps}}}\n ,{{{PVVolts}}}\n ,{{{PVAmps}}}\n ,{{{LoadVoltage}}}\n ,{{{LoadAmps}}}\n ,{{{CurrentChannel1A}}}\n ,{{{CurrentChannel2A}}}\n ,{{{CurrentChannel3A}}}\n ,{{{CurrentChannel4A}}}\n ,{{{CurrentChannel5A}}}\n ,{{{CurrentChannel6A}}}\n ,{{{CurrentChannel7A}}}\n ,{{{CurrentChannel8A}}}\n ,{{{CurrentChannel1B}}}\n ,{{{CurrentChannel2B}}}\n ,{{{CurrentChannel3B}}}\n ,{{{CurrentChannel4B}}}\n ,{{{Voltage1}}}\n ,{{{Voltage2}}}\n ,{{{Relay5}}}\n ,{{{Relay6}}}\n ,{{{Relay7}}}\n ,{{{Relay8}}}\n ,{{{Volt_Battery2}}}\n ,{{{Amp_Battery2}}}\n ,{{{Volt_PV2}}}\n ,{{{Amp_PV2}}}\n ,{{{Load_Voltage2}}}\n ,{{{RelayRandom}}})","outField":"payload","x":610,"y":380,"wires":[["148c2403.9c926c"]]},{"id":"148c2403.9c926c","type":"debug","z":"12ce0a0e.af95c2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":710,"y":520,"wires":[]},{"id":"dba83a6d.a23ee8","type":"pac-device","z":"","address":"192.168.1.50","protocol":"http"},{"id":"ecababf4.5b8728","type":"MSSQL-CN","z":"","name":"Azure Opto","server":"168.61.182.91","encyption":true,"database":"OPTO"}]