Hello, first time poster here! I’ve been working to replace some older python scripts that export data from MSSQL and import it into MariaDB. I can successfully do this with nodered function by creating separate insert statements for the data using the node-red-node-mysql process, using a parameterized insert statement. What’s tripping me up is that I'm doing ~150,000 inserts, and I want to validate that the process is completed successfully, and do it as fast as possible. It would seem that the most straightforward way is to use the VALUES ? parameter in the query in the .topic, and feed an array of arrays via the .payload, but I cannot, for the life of me, get it to work.
For diagnostic purposes, I have broken it down to just a function node that states:
msg.payload = [["aa","bb","cc","dd","ee","ff","gg","hh","ii"],
["ab","bc","cd","de","ef","fg","gh","hi","ij"]];
msg.topic = "insert into Company_ShipTo (Name,Address1,Address2,Address3,City,State,Zip,CoNum,CustNum) VALUES ? ;";
return msg;
and pass that to the node-red-node-mysql node, which will only produce:
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 ''aa', 'bb', 'cc', 'dd', 'ee', 'ff', 'gg', 'hh', 'ii'' at line 1
This same node will take hundreds of thousands of individual inserts. Can anyone point me in the direction of what I’m doing wrong here?
Nodered 4.1, node-red-node-mysql 2.0.0