Good Afternoon!! Now, I currently developed nodered data send to SQLite DB. Here table is created but no data is stored in particular DB. Can you able to check my node flow. I updated below. I shared some details for your reference.
My Node Flow :
[
{
"id": "46d14a4e416a8d6a",
"type": "debug",
"z": "7d551c48106025c7",
"name": "Debug Output",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 880,
"y": 200,
"wires": []
},
{
"id": "2998ba3a5b05beaa",
"type": "sqlite",
"z": "7d551c48106025c7",
"mydb": "database1",
"sqlquery": "msg.topic",
"sql": "",
"name": "SQLite Node",
"x": 690,
"y": 200,
"wires": [
[
"46d14a4e416a8d6a"
]
]
},
{
"id": "1965d63de4ce50a6",
"type": "function",
"z": "7d551c48106025c7",
"name": "Prepare SQL Query",
"func": "//\n\nmsg.topic = \"INSERT INTO data (timestamp, value) VALUES (?, ?)\";\nmsg.params = [msg.payload.timestamp, msg.payload.value];\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 480,
"y": 200,
"wires": [
[
"2998ba3a5b05beaa"
]
]
},
{
"id": "3adeb6a4606db0b1",
"type": "inject",
"z": "7d551c48106025c7",
"name": "Inject Data",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"timestamp\": \"2025-01-10T15:45:00\", \"value\": 123.45}",
"payloadType": "json",
"x": 280,
"y": 200,
"wires": [
[
"1965d63de4ce50a6"
]
]
},
{
"id": "database1",
"type": "sqlitedb",
"db": "C:/Users/User/Desktop/mydata.db",
"mode": "RWC"
}
]
I need solution for this. Thank you....