How can I delete a record being inserted into a specific condition in a trigger?
example:
USE 'scompraslenovo';
DELIMITER $$
CREATE TRIGGER 'precad_fornecedor_BUPD' BEFORE UPDATE ON 'precad_fornecedor' FOR EACH ROW
BEGIN
IF (new.f1 IS NULL) AND (new.f2 IS NULL) AND (new.f3 IS NULL) THEN
DELETE FROM precad_fornecedor
WHERE precad_fornecedor.codigo = NEW.codigo;
END IF;
END
Is there any way to make it work?