Setiap sql dinamis harus menggunakan MySQL Pernyataan yang Disiapkan .
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$$
tes:
call LIST('course');
call LIST('tutor');