Trigger function in MySQL

Trigger in MySQL. I am trying to create trigger in mysql  for every incoming data from remote device. Example i will receive data from remote device the Length and Width - value in integer datatype, therefore the trigger function will calculate the Area and Volume and update the row. I do manage to do this. The question is as follows : -

If no incoming data from remote device, i would like to trigger every 5 sec and calculate the Area and Volume with default value. If data come in from remote device then i have to reset the 5 sec from zero. As thought as a watch dog.
Rama TitoProgrammerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lcohanDatabase AnalystCommented:
"If no incoming data from remote device, i would like to trigger every 5 sec and calculate the Area and Volume with default value."
If there is NO data change into the table where the trigger is this calculation would be a waste - right? I mean if nothing changes in that table the the area and volume would be the same as default data won't change. For scheduling events that can call a function for instance you could use https://dev.mysql.com/doc/refman/8.0/en/events-overview.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rama TitoProgrammerAuthor Commented:
Hi Expert,

In real situation, i am not calculation the area and volume. I am doing production monitoring which base on every seconds. Production Target compare with actual production will run simultaneously. Target = (current time - start time)/cycle time of production. Therefore every 5 sec i will update my database.
0
Rama TitoProgrammerAuthor Commented:
The links helped
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.