Mysql trigger to block a row delete
- by rtacconi
I wuold like to define a trigger to block the deletion of the row with ID 2 of the configuration table, you might guess why, I am trying something like that:
CREATE TRIGGER do_not_delete_configuration_1 BEFORE DELETE ON configuration
FOR EACH ROW BEGIN
IF (OLD.configurationid != 1) THEN
DELETE FROM configuration WHERE configuration.configuration=OLD.configurationid;
END IF;
END;
|
without a positive result.