MySQL Forums
Forum List  »  Events (Job Scheduler)

trying to use an event
Posted by: Dimitris Papageorgiou
Date: September 01, 2016 07:25AM

I am trying to use EVENT to automate the process of emptying a table and inserting some values in it.

There are 2 issues here though.

The SQL statements(delete/insert) contained in the EVENT must run every every 7 months(that is the requirement of the app I am building) .As such the values to be inserted must be different each time.

How I could accomplish these two things....I do not think the first is difficult,there must be a CLAUSE/KEYWORD that will automate the queries running every 7 months.

But the second...?

here is a demo query to get an idea of what I am trying to accomplish:

delimiter |
CREATE EVENT empty_avail_apps_table
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 5 minute
DO
BEGIN
DELETE FROM avail_apps;
INSERT INTO avail_apps (date_av,time_av)
VALUES ('2016-07-15','09:00:00');
END |
delimiter;

The values inserted in the example above are fixed...these must be different though whenever the sql statements run at the specified period(every 7 months).

Options: ReplyQuote


Subject
Views
Written By
Posted
trying to use an event
1062
September 01, 2016 07:25AM
512
September 01, 2016 11:06AM
507
September 01, 2016 09:55PM
505
September 01, 2016 11:22PM
547
September 02, 2016 08:21AM
646
September 02, 2016 11:03AM


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.