如何在存储过程或触发器中获取结果?
这是我的代码:
DROP TRIGGER IF EXISTS `log_activity`;
DELIMITER ;;
CREATE TRIGGER `log_activity` AFTER INSERT ON tbl_1
FOR EACH ROW
BEGIN
SET @RESULT = (SELECT id,name FROM tbl2);
END ;;
我希望我的代码类似:
WHILE @RESULT BEGIN
//i want to get the value of the id and name
END;
答案 0 :(得分:0)
阅读本文: http://www.roseindia.net/sql/trigger/mysql-trigger-after-insert.shtml 这可能是为了将来参考: http://www.roseindia.net/sql/trigger/mysql-trigger-after-update.shtml
在字段名称
之前注意“新”和“旧”前缀