Problem in a stored procedure if you try to pass variables using MySQLYou need to ensure that the variable 'period' is accessible in the dynamic SQL context.