举个例子:
DELIMITER $$
DROP PROCEDURE IF EXISTS `USP_kider`$$
CREATE DEFINER=`root` @ `localhost` PROCEDURE `USP_kider`(v_test VARCHAR(255))
BEGIN
IF(v_test IS NOT NULL AND v_test!='') THEN
SET @v_Statement1 = CONCAT('select * from ', v_test);
PREPARE ps_Statement1 FROM @v_Statement1;
EXECUTE ps_Statement1;
END IF;
END$$
DELIMITER ;