过程:
DELIMITER //
CREATE PROCEDURE sample_proc(IN wr VARCHAR(255))
BEGIN
SELECT some_function_with_result_code_int();
END;//
DELIMITER ;
和触发器:
DELIMITER //
CREATE TRIGGER sample_trigger
AFTER UPDATE ON test
FOR EACH ROW
BEGIN
DECLARE some_name VARCHAR(255);
IF OLD.age <> NEW.age THEN
SELECT name INTO some_name FROM test WHERE OLD.age <> NEW.age;
CALL sample_proc(some_name);
END IF;
END;//
DELIMITER ;
无法理解如何仅更新一行的“年龄”列可能会导致多行更改...将不胜感激任何帮助。