Good morning, I have the following problem: I need to change the states after a deadline (table date column date ) and at the same time change the states where reference the iddocumento (including the one in the document ),
This is my table document :
This is my table date
This is my table movement
With this code I can change the status of the date
tableSET GLOBAL event_scheduler = ON;
SELECT @@event_scheduler;
CREATE EVENT verificar_tramite
ON SCHEDULE
EVERY 1 MINUTE
DO
UPDATE fecha f
set f.estado='INACTIVO'
where f.fecha <= NOW();
But I do not know how I could get the iddocumento and apply it in the other tables, any suggestions?