your MySQL server version for the right syntax to use near 'NULL' at line 1

来源:互联网 发布:大连知行小学电话 编辑:程序博客网 时间:2024/06/05 15:13

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 ‘NULL’ at line 1

    今天使用mysql事件执行一段程序,      set @deletesql =CONCAT('DELETE from classuserorder',' where a=',a);    PREPARE stmt FROM @deletesql;    EXECUTE stmt ;     DEALLOCATE PREPARE stmt;    老是报异常,看错误应该是sql中有null,应该是concat拼接null后结果@deletesql为null,导致报错,对参数a做下判断即可
0 0
原创粉丝点击