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 , ‘)’) ;……