I am currently working on creating a datalogger using OPCUA. For some reason, I'm unable to get the msg.payload into the sqlite, because it's saying that the payload is undefined. Could anyone help with this Issue?
*
It is saying that you are trying to access column named undefined. Use a debug node to see what is coming out of the write query function so that you can check what you are actually sending to the database.
msg.topic should be a string containing the query. Possibly something like msg.topic = "INSERT INTO RANDOMNUM VALUES (" + x + ")"
Though I find it much easier to use this syntax for making complex strings
msg.topic = `INSERT INTO RANDOMNUM VALUES ( ${x} )`
Also make debug 3 output Complete Message so you can more easily see what is in the topic.
In addition I recommend adding another debug node showing what is going into the function to check that what you expect is there.