I am new into Node Red and i learn a lot.
There is one issue wich i cant solve with an online search.
Maybe i am getting something wrong…
I would like to Update a Value on a SQL Database table.
For testing i use an inject node and the node-red-contrib-mssql-plus node.
The payload from the inject node is : " UPDATE [Tablename] SET Value = 1337 WHERE Key = 'Key' " .
The Settings of the SQL Node are done and correct. The database is online.
Ps, the first test I always do is to do a simple SELECT TOP 5 * FROM [tablename] to ensure that the SQL node is connected to the right SQL server and the correct database.
(Don't forget to add a debug (complete message) to the output of MSSQL)
I installed more then one SQL node.
Today i used a new one:mysql
With that one i get error Messages. The database was moved and changed in the last days so atm i have Access denied Errors. i have to wait for the dataase admin to check the Rights for the mqtt user.
So after the Rights where granted everything works fine
Now i Need to Setup the query for the whole Thing. I think i can write that static , i Need to get it to work today
Many thanks for your help!
If i stumble over the query Generation i will post again.
SQL Database Update is working fine but i Need to put msg.payload.variable or context.get('variable') into my query string. I will continue searching the net for it, but if u have a quick example …
Use the mustache syntax in the MSSQL nodes (all info is on the sidebar info panel) or construct your SQL in a function node and send it in msg.payload to the MSSQL node (again all info in the sidebar panel) (assuming you're using MSSQL-plus and it's latest version)