日期:2014-05-16  浏览次数:20792 次

mysql预处理
SQL code

create procedure proc_batchUpdate(in categoryId integer , in artIds varchar(50))
   begin
    set @dsql = count('update article set type=' , categoryId , ' where id  in (' , artIds , ')') ;   
    prepare s1 from @dsql;
    execute s1;
  end;



我执行这个报错,要怎么改啊?

------解决方案--------------------
检查一下 @dsql; 的内容是什么。 估计你的这个动态的SQL语句语法错误。
------解决方案--------------------
每天回帖即可获得10分可用分!
------解决方案--------------------
探讨
SQL code

create procedure proc_batchUpdate(in categoryId integer , in artIds varchar(50))
begin
set @dsql = count('update article set type=' , categoryId , ' where id in (' , artIds , ')') ;……