use news;
DELIMITER ;;
create TRIGGER delete_categories_teigger
after delete on categories
for each row delete from newsinfo
where
newsinfo.CategoryID=OLD.CategoryID;;
DELIMITER ;执行以上脚本以后出现错误:#1235 - This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
我的阿帕奇服务器是wamp5 1.74应该支持吧 ?如果不支持的话应该从何处着手?
DELIMITER ;;
create TRIGGER delete_categories_teigger
after delete on categories
for each row delete from newsinfo
where
newsinfo.CategoryID=OLD.CategoryID;;
DELIMITER ;执行以上脚本以后出现错误:#1235 - This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
我的阿帕奇服务器是wamp5 1.74应该支持吧 ?如果不支持的话应该从何处着手?
NewsID int(10) unsigned not null auto_increment comment '新闻编号',
Title varchar(60) not null comment '新闻标题',
IssueTime datetime not null default '0000-00-00 00:0000' comment '发布时间',
Content longtext not null comment '新闻内容',
CategoryID tinyint(6) unsigned not null comment '类别编号',
Editor varchar(20) not null comment '编辑姓名',
Source varchar(30) default null comment '新闻来源',
primary key (NewsID)
) ENGINE=InnoDB DEFAULT CHARSET=GBK;
不知道哦 我的newsinfo表是这么创建的,无内容。
DELIMITER ;;
create TRIGGER delete_categories_teigger
after delete on categories
for each row
begin
delete from newsinfo where newsinfo.CategoryID=OLD.CategoryID;;
end;
还是不行,又出现了错误。以上。
OLD指的是你删除掉的数据,既然你没有删除,那么你的OLD从何而来?
你删除的数据记录是就是OLD,而你根本没有删除过,那么你又要查找出你删掉的这条记录,让这条记录的ID等于他自己的ID,
这个逻辑也不通啊。。
错误提示已经很清楚了,你的这张表是已经有trigger了。
用命令 SHOW TRIGGERS 找一下。