Hello.
I need again some help with SQL and NR. I've stored some temp datas into a SQL db. Now I want to "ask" the db for the latest temp.
The db is like this
column "1" = AUTO_INCREMENT
column "temperature_C" = the temp. My function loooks like:
var query;
query ="SELECT Wettersensoren.temperature_C FROM Wettersensoren ORDER BY Wettersensoren.1 DESC LIMIT 1";
flow.set("flowtmp",query);
msg.payload = query;
msg.topic = "Temperatur";
return msg;
The debug output is
"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 'Temperatur' at line 1"
Could anybody give me a hint how to do it correctly?!?
Where does the info tab say the query should be placed and what have you got in there? Feed the output of your function node into a debug node set to Show Complete Message and see whether what you see matches what the node expects.