The most obvious method is to use a trigger.
If you want to implement via trigger
If you are using timers