set @a = 0;
'select @i = count(1) from config‘
set @a = @i;
意思就是运行这么一个动态的sql语句,要把@i赋值给存储过程的变量
以下是我问题代码
create procedure AAAAAAAAAAAA(out totalItem int)
begin
DECLARE s1 varchar(2000);
set @i = 2;
PREPARE s1 from ' set ?:=count(1) from gameorder where id=?';
execute s1 using @i;
set totalItem = @i;
end
如果觉得我说的不清楚的,请联系QQ282873744
drop procedure if exists AAAAAAAAAAAA;
delimiter $$
create procedure AAAAAAAAAAAA(out totalItem int)
begin
DECLARE s1 int;
set @i = 99;
PREPARE s1 from ' select count(1) into @i from gameorder';
execute s1;
set totalItem = @i;
end$$
delimiter ;