MySQL Forums
Forum List  »  Triggers

Make my first triggers schedule an action at a certain time
Posted by: Crescenzo Cuomo
Date: June 25, 2019 01:51AM

Hello everybody,
I need support to create my first mysql triggers,
briefly explaining the situation I tell you:

I have an appointment table in the database,
my requirement is that every day at 20:00 the triggers identify all the appointments
who have given (equal to today's date) and been "IN PRODUCTION" appointment and moved to half
update all appointments the following day:

I tried to throw you down a bland attempt:

delimiter $$;

CREATE TRIGGER update_data
BEFORE UPDATE ON nomedb.appuntamenti
FOR EACH ROW
BEGIN
IF nomedb.data = CURRENT_DATE AND stato_pren = "LAVORAZIONE" THEN
SET nomedb.data = DATE_ADD(data, INTERVAL 1 DAY);
END $$

DELIMITER ;

I thank all of you in advance

Options: ReplyQuote


Subject
Views
Written By
Posted
Make my first triggers schedule an action at a certain time
372
June 25, 2019 01:51AM


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.