1 DECLARE temp1 varchar(30); 2 DECLARE temp2 int; 3 set temp1=m_tableName; 4 set temp2=m_maxCount; 5 set @sqlStr=CONCAT('select * from ',temp1,' limit ',temp2); 6 PREPARE stmt from @sqlStr; 7 EXECUTE stmt;