Add temp table gen code