Qualsiasi sql dinamico deve utilizzare MySQL Dichiarazioni preparate .
DROP PROCEDURE IF EXISTS `LIST`;
DELIMITER $$
create procedure LIST(in tableName varchar(35))
BEGIN
SET @sql=CONCAT('select * from ',tablename);
PREPARE stmt1 FROM @sql;
EXECUTE stmt1;
DEALLOCATE PREPARE stm1;
END$$
prova:
call LIST('course');
call LIST('tutor');