Tout SQL dynamique doit utiliser MySQL Déclarations préparées .
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$$
tester :
call LIST('course');
call LIST('tutor');