我使用它来防止从MySQL表user
delimiter //
CREATE TRIGGER tr_no_del BEFORE DELETE on user
FOR EACH ROW SET
BEGIN
UPDATE user SET a=0;
END;//
delimiter ;
但是mysql给出了一些语法错误,我在这里缺少什么想法?
谢谢!
答案 0 :(得分:1)
尝试这个
DELIMITER //
DROP TRIGGER IF EXISTS tr_no_del//
CREATE TRIGGER tr_no_del BEFORE DELETE ON `user`
FOR EACH ROW
BEGIN
UPDATE USER SET a=0;
END;//
DELIMITER ;