5
I have two tables, one with the sessions and the other with the activities. Within the table activities I have two fields, available and saleable and within session I have vacancies.
I would like to get the session id so I can update to the sellable field, when I reset the vacancies that the activity field.sellable update to 0.
DELIMITER $$
CREATE TRIGGER atualizarStatus
AFTER UPDATE ON sessao
FOR EACH ROW
BEGIN
IF (sessao.vagas = 0) THEN
UPDATE atividade SET vendivel = 0 WHERE id = $id;
END IF;
END;
This is not the idea of triggers, you might want to run a precedent. The only "parameters" in a Rigger are the new lines
new.*
and ancientold.*
– gmsantos
A doctor can do what I want?
– Matheus Azevedo