MySQL存储过程中如何保存select count(*)的结果为整数
码丁农 2011-04-16 05:44:36 ....
....
....
declare cnt_model int default 0;
set @stmt2 = concat("select count(1) from WareModel where TypeID = '", @t_typeid, "' into @t_model");
prepare s2 from @stmt2;
execute s2;
DEALLOCATE PREPARE s2;
set @stmt2 = NULL;
请问,如何把@t_model赋给cnt_model?
while i_model < cnt_model DO
...
...
...