Last active
April 16, 2018 16:53
-
-
Save ianldgs/aee4f3d968d54ee8d398 to your computer and use it in GitHub Desktop.
Cancel delete mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER | | |
CREATE TRIGGER cancel_delete BEFORE DELETE ON table | |
FOR EACH ROW | |
BEGIN | |
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'DELETE canceled'; | |
END | | |
DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment