Hi guys, i'm trying to work with node red since one week. Watching some videos was possible to have communication with the Rockell PLC, get the variables i need and got communication with the SQL Server.
I don't know how to "treat" the tags list from de flow below and send it to inside SQL server:
Can you help me on that ?
Since all your values come in to node-red as separate items, you will need to use a join node set to make a key/value object. That will get all your values in one object.
See this article in the cookbook for an example of how to join messages into one object.
Also, if that is node-red-contrib-mssql you are using, I strongly recommend you replace it with node-red-contrib-mssql-plus there are many benefits not least including prepared procedures and parameters to simplify things and protect you from SQL injection.
Can you paste your flow here?
I would also like to see your SQL Query to insert the data. Maybe the problem is there.
Thanks for the help @Steve-Mcl, now we have a group of items and a new and improved node:
I know almos nothing in how to write the Query commands, now i think this is the problem as @machadotiago said;
I would like to write the tags name in the column "Topic" and the tag value inside the column "Payload"
Thanks from Brazil guys
ah, as you wish to write them individually (instead of one object with all values), you have added the join node for no reason. oops.
So your original flow without the join node should work so long as topic and payload are set. I also would change it to use parameters...
Thanks for the help again @Steve-Mcl, now it's workig
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.