码迷,mamicode.com
首页 > 数据库 > 详细

Mysql触发器使用过程中遇到的问题

时间:2015-05-13 19:50:00      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:mysql   触发器   trigger   

[1054] Unknown column ‘xxxxx‘ in ‘where clause‘

DROP TRIGGER IF EXISTS `delete_actdata`;
CREATE DEFINER=`xxxxxx`@`localhost` TRIGGER `delete_actdata`
BEFORE DELETE ON `actdata`
FOR EACH ROW
BEGIN
  DELETE FROM `great` WHERE `great`.`actid`=`actid`;
  DELETE FROM `join` WHERE `join`.`actid`=`actid`;
  DELETE FROM `get` WHERE `get`.`actid`=`actid`;
  DELETE FROM `signup` WHERE `signup`.`actid`=`actid`;
  DELETE FROM `vote_option` WHERE `vote_option`.`actid`=`actid`;
  DELETE FROM `vote_users` WHERE `vote_users`.`actid`=`actid`;
END;

删除的每个表中的字段名称要与触发器所在表的字段名一致

Mysql触发器使用过程中遇到的问题

标签:mysql   触发器   trigger   

原文地址:http://blog.csdn.net/vichild/article/details/45695773

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!