急急,求解答触发器错误!

在-云端 2010-04-14 02:20:30
CREATE TRIGGER changeinsert BEFORE INSERT ON cdr
FOR EACH ROW
BEGIN
IF NEW.dstchannel != '' THEN
IF ((not exists(select id from asterisk.devices where concat(id)=NEW.dst)) and (not exists(select id from asterisk.users where extension=NEW.dst))) THEN
SET NEW.servicenum = 'out';
ELSE
SET NEW.servicenum = 'in';
END IF;
END IF;
END


执行之后:
MySQL 返回:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6

有谁知道我哪出语法错误了?

servicenum字段 是varchar(30)类型
...全文
72 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
在-云端 2010-04-15
  • 打赏
  • 举报
回复
已经解决了!是分隔符的问题!
lxwhite 2010-04-15
  • 打赏
  • 举报
回复
坐等高手
wangdiao0412 2010-04-14
  • 打赏
  • 举报
回复
from `asterisk`.`users` where `extension`=NEW.dst))) THEN
php连mysql中用`标记住在服务器执行

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧