MySQL Forums :: Stored Procedures :: Insert on time difference greater than


Advanced Search

Insert on time difference greater than
Posted by: Manny B ()
Date: May 17, 2016 11:21AM

Hi,

I have a python script that logs codes to a database via serial input. Is it possible to have a storage procedure that checks the last instance `receiver` and blocks the insert if the time difference is greater than 10 seconds.

At the moment I'm using this query to delete them at the end of the day.

DELETE b
FROM code_reader a
JOIN code_reader b ON a.tag_number= b.tag_number AND a.receiver=b.receiver
WHERE TIME_TO_SEC( TIMEDIFF(b.time,a.time)) BETWEEN 1 AND 10

Thank you

Manny

Options: ReplyQuote


Subject Views Written By Posted
Insert on time difference greater than 2036 Manny B 05/17/2016 11:21AM
Re: Insert on time difference greater than 395 Peter Brawley 05/17/2016 11:28AM
Re: Insert on time difference greater than 343 Manny B 05/17/2016 11:44AM
Re: Insert on time difference greater than 336 Peter Brawley 05/17/2016 12:44PM
Re: Insert on time difference greater than 365 Rick James 05/24/2016 10:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.