i need to create table with a variable name.
Heres my code, i dont know why it not work.
BEGIN
SET @tablename = tablename;
SET @sql_text = concat('CREATE TABLE ',@tablename,' (ID INT(11) NOT NULL, team0 DOUBLE NOT NULL, team1 DOUBLE NOT NULL)');
PREPARE stmt FROM @sql_text;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END
And here is the error:
Procedure execution failed
1054 - Unknown column 'TestTableName' in 'field list'