THEN
SET NEW.innerValue1LastChanged = CURRENT_TIMESTAMP;
END IF
(это всё в FOR EACH ROW, BEFORE UPDATE).
А как подкинуть сюда правильно остальные?
Разобрался: BEGIN IF (NEW.innerValue1 != OLD.innerValue1 ) OR (NEW.innerValue1 IS NOT NULL AND OLD.innerValue1 IS NULL) OR (NEW.innerValue1 IS NULL AND OLD.innerValue1 IS NOT NULL) THEN SET NEW.innerValue1LastChanged = CURRENT_TIMESTAMP; END IF; IF (NEW.innerValue2 != OLD.innerValue2 ) OR (NEW.innerValue2 IS NOT NULL AND OLD.innerValue2 IS NULL) OR (NEW.innerValue2 IS NULL AND OLD.innerValue2 IS NOT NULL) THEN SET NEW.innerValue2LastChanged = CURRENT_TIMESTAMP; END IF; END
Обсуждают сегодня