储蓄过程变量有关问题

储蓄过程变量问题createproceduretest(intblvarchar(32),outcntint(11))begin/*这里怎么写执行类似selectc

储蓄过程变量问题
create   procedure   test(   in   tbl   varchar(32),out   cnt   int(11)   )
begin
/*
这里怎么写执行类似
select   count(*)   into   cnt   from   {$tbl};
的语句
*/
end

[解决办法]
参考:

create procedure countNum
(
in tbName varchar(100),
out allPages int
)
begin
set @sqlStr = CONCAT( 'select count(*) into @allPages from ',tbName);
prepare sqlstmt from @sqlStr;
execute sqlstmt;

set allPages = @allPages;

deallocate prepare sqlstmt;
end;
[解决办法]
http://blog.chinaunix.net/u/29134/showart_255219.html