DROP PROCEDURE IF EXISTS CreateATable;

DELIMITER $$ 

CREATE PROCEDURE CreateATable( _TableType tinyint )
    
BEGIN  
    
    /*
		End of Declarations
    */
    
	DROP TEMPORARY TABLE IF EXISTS aTable;
    
    IF _TableType = 1 THEN
    
		SET @SQL_Statement := 
		CONCAT(
        'CREATE TEMPORARY TABLE aTable (', 
		'the_id bigint, ',
        'the_column varchar(100) ',
        ') engine=INNODB',
        ';');
	
    ELSE
            
		SET @SQL_Statement := 
		CONCAT(
        'CREATE TEMPORARY TABLE aTable (', 
		'the_id bigint, ',
        'the_other_column varchar(100) ',
        ') engine=INNODB',
        ';');
        
	END IF;

	PREPARE stmtCreateTable FROM @SQL_Statement;
	EXECUTE stmtCreateTable;	
	DEALLOCATE PREPARE stmtCreateTable;	
	
	SET @SQL_Statement := NULL;
    
END$$

DELIMITER ;