-1
How can I delete a record that is being entered in a specific condition in a Rigger?
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?
This code only executes when you update a record, not when you enter it.
– mutlei
Putting out the Trigger?
– LucasMotta
Deleting Trigger will only cause the action it performs not to occur.
– mutlei
Exactly, if Trigger is entering a record, and he wants to delete that record, just don’t insert it, that is, don’t perform the insertion action, or delete Trigger
– LucasMotta
They could edit the code to see how it would look in this case?
– mcardoso