📜  触发库存 phpmyadmin 输出消息 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:57.204000             🧑  作者: Mango

代码示例1
DELIMITER $$

CREATE TRIGGER testa_trig  
BEFORE INSERT ON testa 
FOR EACH ROW BEGIN
    IF (NEW.c > 100) THEN 
        SIGNAL SQLSTATE '02000' SET MESSAGE_TEXT = 'Warning: c > 100!';
    END IF;
END$$

DELIMITER ;