I was creating a temporary table in my procedure, but I always got an error "table already exists".
Then I tried to create a random name to avoid collision but I don't know enough about how to execute SQL strings
SET @tbName = CONCAT('temp', random_id);
PREPARE stmt1 FROM 'CREATE TEMPORARY TABLE ? (`FIELDNAME` float NOT NULL);';
EXECUTE stmt1 using @tbName;
DEALLOCATE PREPARE stmt1;
The code above doesn't works. Why? How to correct it?