mysql 触发器,检查了好几个小时了,觉得没有问题,每次在倒数第二行end if那报错 1064 不知道什么原因, 50
CREATETRIGGERqis_trigger_bdc_updateAFTERUPDATEONqis_t_basedatacategoryFOREACHROWBEGIN...
CREATE TRIGGER
qis_trigger_bdc_update
AFTER
UPDATE
ON
qis_t_basedatacategory
FOR EACH ROW
BEGIN
DECLARE record int(10);
SELECT count(*)
INTO record
FROM ccec_t_triggerrecord
WHERE ATTR_FOR_SYNC = OLD.ID
AND TRIGGER_TYPE = 'update';
IF record > 0 THEN
set record=2;
END IF;
END; 展开
qis_trigger_bdc_update
AFTER
UPDATE
ON
qis_t_basedatacategory
FOR EACH ROW
BEGIN
DECLARE record int(10);
SELECT count(*)
INTO record
FROM ccec_t_triggerrecord
WHERE ATTR_FOR_SYNC = OLD.ID
AND TRIGGER_TYPE = 'update';
IF record > 0 THEN
set record=2;
END IF;
END; 展开
2个回答
展开全部
你没有定义sql语句的结束符 我觉得你应该用delimiter定义一下
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询