Click here to Skip to main content
16,016,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,
Can I write a trigger in mysql that fires at a particular time every day?
Please suggest solutions.
Posted
Comments
Renuka Ruke 3-Jan-14 0:56am    
Yes You can

Triggers have no connection with Periodical Executions.
Msdn says:
A trigger is a special kind of stored procedure that automatically executes when an event occurs in the database server.DML triggers execute when a user tries to modify data through a data manipulation language (DML) event. DML events are INSERT, UPDATE, or DELETE statements on a table or view. These triggers fire when any valid event is fired, regardless of whether or not any table rows are affected.

Note that:when an event occurs in the database server

You have to raise an event either manually or automatically.Without Event occurance Trigger cannot work.
Periodical executions are different from these things.It Executes at given time Once it is scheduled there is no need to call,raise anything until schedules get completed.
If you wants to do automatically there are some options available

Job Scheduling(Sql server or mysql whatever it is)
Windows Task Schedular
Quartz
Cron Job

By these scheduling mechanism you can raise any events.It may be a Storeprocedure,Triggers, Functions,Views ...

Hope you Understand what i'm trying to say...
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900