I have the following code in Node Red:
msg = {
"topic": "INSERT INTO TestTable (PV, SV) values (" + "'" + parseFloat(flow.get("PV") / 10) + "," + parseFloat(flow.get("SV")) + "')",
}
return msg;
However, I am getting the following error: "Error: SQLITE_ERROR: 1 values for 2 columns". Both PV and SV are valid values which I have verified by outputting both individually. What can I do?
I figured that error out. I am not stuck on a new error. Here is my corrected code:
msg = {
"topic": "INSERT INTO TestTable (PV, SV) values (" + "'" + parseFloat(flow.get("PV") / 10) + "'" + parseFloat(flow.get("SV") / 10) +",')"
}
return msg;
and here is the error: "Error: SQLITE_ERROR: near "20.3": syntax error". where 20.3 is the value of SV.