0

如何在存储过程或触发器中获取结果?

这是我的代码:

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 ;;

我想要我的代码:

当@结果开始时

//i want to get the value of the id and name

结尾;

4

1 回答 1

0

阅读此内容: http ://www.roseindia.net/sql/trigger/mysql-trigger-after-insert.shtml ,可能是此供将来参考: http ://www.roseindia.net/sql/trigger/mysql-更新后触发.shtml

注意字段名称前的“新”和“旧”前缀

于 2012-07-19T08:57:17.403 回答