Update query in sqlite3 with fob id coming from gateway code

Interesting .. the plot thickens ..

So the field seems to be there ..
Shipra .. run those commands Steve send you and run the select * query to see the result with the headers on

What ? where ? :wink:

Sir headers i have on but see o=how my output is looking

SrNo        Date_and_Time  Event_Type  Event_Description  Person_ID   Person_Name_Description  Fob_Tag_ID  Door_ID     Door_Description  Status    
----------  -------------  ----------  -----------------  ----------  -----------------------  ----------  ----------  ----------------  ----------
1                                                         04222436                             2813                                      "DR1_ON"  
2                                                         04222437                             2814                                                
sqlite> 


Did you change something in node red to get it working ? and where?

i have added " " this in switch payload

well .. im glad its working

Thank you sir for helping

Hello Sir,good Morning One query i have . I have to update my database directly when i get CR_SUCCESS not by that Door Switch .how can i do this.

we don't know the latest updates you made in your flow to answer that .. but i think you have to move the update db logic, after your switch node that produces that CR_SUCCESS message.

Sir, when i am getting CR_SUCCESS automatically DR gets ON. But I want that after 5 secs DR OFF should be updated in DB.
And again if someone scan with Person ID again DR ON gets updated on DB?

It seems that you need to introduce a delay in your messages.
There is a video on the Node-red youtube channel for this.

Node-RED Essentials Playlist

Sir ,I have done and tried some way with some delays but not getting the required output.
Please can you check ones and give any modifications

1

Im sure if you study all the tutorials in that playlist you will find the solution the same way you found the solution before when you were trying to do the sql UPDATE.
You found the solution for that. not me :wink:

Sir ,you helped me in that not me.
Sir i have posted one screenshot please check where i am wrong.

Which node in the flow is not doing what you expect? What is it doing and what do you expect it to do?

DR1 OFF_Person ID is not working .I want after getting CR_SUCCESS DR1 ON should get updated in DB and the after 4s delay DR1OFF_Person ID should update DR1OFF in the same column of DB.

Do you mean the delay is not working or the function node is not working? If you have the delay node set to Delay Each Message then each message will get sent four seconds after that message was received, so if you get two messages one after the other going in then they will both appear together four seconds later on the output. I wonder whether what you want is to force a delay between messages, in which case perhaps you want it in Rate mode, one message every 4 seconds.

Hello Sir, I will elaborate my aim ones .Actually I have a DB where Status is a column in which any updation is send by node red .
In gateway code I am taking Person_ID(Similar to rfid) if that id exist in DB CR_SUCCESS i am receiving.
Now after CR_SUCCESS automatically DR1 should get open and DR1ON should get updated on Status column in DB.
My Query is after updating DR1ON in DB after 4 or 5 sec DR gets closed and DR1OFF should get updated again in DB.

So which node is not doing what you expect? If it is the function node then show us what is going into it, what is coming out and what you want instead. Also post the function node text, using the </> button and paste it in.
If it is the delay node then screenshot a debug showing what is going in and another showing what is going out so we can see the timings, and tell us what is wrong with the timings.

Sir may be I am wrong ,please check and suggest

let newMsg1 = {};
newMsg1.topic = `UPDATE NCS_DATABASE SET Status='DR1 ON' WHERE Person_ID='04222436'`;
return newMsg1;