Hello, I am trying to make a query to a mysql table filtering the data by the date that interests me at the time of the query, the connection and the query are created if errors but the msg has no data, the array appears empty when As seen in the image of the mysql table if there is data on that date,
Any suggestions ?? Since I have tried many things and to no avail, I attach images since the flow is quite simple.
Assuming a datatype of "Datetime":
You need to wrap the dates in single quotes: "select * from datos where tiempo between '2021-10-10' and '2021-10-22'"
There are several posts on the forum about Node-Red running out of memory, I've not seen the problem myself.
Is the database MySQL or Mariadb? (not sure if they are synonymous)
What hardware and OS are they running on?
Are you using Docker?
What versions of Node-Red (from the hamburger menu), node.js (node -v) and database (mariadb --version) do you have?
now I would like the query of dates not to be fixed, that it could be consulted from the dashboard choosing the range of dates that you select for the query
that would be similar to what I had
msg.topic = "SELECT * FROM data where TIME between" + start + "and" + end + ";";
from what I understand with node red working with this volume of data is complicated, because I am trying to create a csv with those 8 thousand arrays and it exploits node red
Creating a csv should be ok, but I think you were sending it to a dashboard table. How could you possibly scroll down through a table that long in the browser?
I think you just need to include the single quotes in your strings:
msg.topic = "SELECT * FROM data where TIME between '" + start + "' and '" + end + "' ;";
the problem now is to generate a cvs file with an array of objects which is the load format extracted from mysql, as you can see I have a little sequence below where I simulate an array of objects and it works fine as it only has 3 objects but when it i do with mysql node network payload explodes
I answer myself hahaha the node csv the only thing it does is separate by commas when I already get that from mysql, it seems that it works friends thanks for the help