Update query in sqlite3 with fob id coming from gateway code

If you always want the timestamp to be the current time then you can define a datetime column with a default of the current time, then sqlite will automatically put the current time in for you. https://stackoverflow.com/questions/200309/sqlite-database-default-time-value-now

yes ,it has
Date_and_Time TEXT NOT NULL

Sir for this i have to make another table in my DB right?

No, why would you need to do that?

[Edit] Google for how to add a column to a table.

Sir I have this already in my DB ,i have made this only for timestamping purpose

Well change it the correct column type and default value. These questions are nothing to do with node-red, they are about using sqlite.

@shipra can you tell us why you are collecting the data? What will it be used for?

Knowing this may help us guide you to a solution.

Sir ,i making RFID project ,so for that node red I am using,
i want the time when any person swap the card successfully and get updated in DB as well.(time also)

not getting options

image

But what are you going to use that data for? Are you looking to be able to tell all the times a preson opens the door?

yes sir,i want that time whenever a person opens a gate

Sir drop command is showing error

ALTER TABLE NCS_DATABASE
...> DROP COLUMN Date_and_Time;
Error: near "DROP": syntax error

If you want to know everytime a person opens the door, you need to ADD an new row to the database each time. If you just UPDATE a row, it will only show the LAST time the person opened the door.

You can't drop a column in sqlite, you will need to drop the table and re-create it.

Acc to first scenerio,my db gets fulled and my ram gets filled and my code get stuck so any other way you know to accomplish first scenerio

What are you running node-red on? how much storage do you have?
How many times do you run it till the database gets filled up?

Sir this node red i have to run on a arm board

Look at the questions @zenofmud just asked. How many of the questions have you answered?

1 Like

only for testing purpose i am doing this on my linux .So storage for now is not an issue.
How can i implement your scenario 1.Kindly suggest.

If you are going to put this on another computer, it is important we know the features of that computer.

If you want help, please answer all of the following questions
1 - what kind of arm computer will you be using
2 - what operating system will it be running on?
3 - how much ram does the computer have?
4 - how much memory does the computer have?
5 - how long - on the target computer - does it take before "my code get stuck"