 		end
 
 		insertStatement = 
-			'INSERT INTO ' .. string.upper(given_fact_table_name) .. ' (' .. insertSegment .. ', ' .. factTable[3][1] .. ') (SELECT ' .. selectSegment .. ', ' .. factTable[2][1] ..
+			'INSERT INTO ' .. target_schema .. '.' .. string.upper(given_fact_table_name) .. ' (' .. insertSegment .. ', ' .. factTable[3][1] .. ') (SELECT ' .. selectSegment .. ', ' .. factTable[2][1] ..
 			' FROM ' .. target_schema .. '.' .. target_table 
 	
 		local leftJoins = ''

			target_table .. '.' .. factTableIndividualColumns[c][2] .. ' IS NULL))'
		end
		
		insertStatement = insertStatement .. leftJoins .. ' WHERE NOT EXISTS (SELECT 1 FROM ' .. given_fact_table_name .. ' WHERE (' .. whereClauseKeyComparator .. ') AND (' .. whereNotExistsClause .. ')))'
		
		return insertStatement
	end

			factTable[1][1] = dimensions[a][4] .. ' DECIMAL(10,0), ' .. factTable[1][1] .. ', FOREIGN KEY(' ..  dimensions[a][4] .. ') REFERENCES ' .. dimensions[a][1] ..'(' .. dimensions[a][3] .. ')'
		end
		
		factCreateStatements = 'CREATE OR REPLACE TABLE ' .. target_schema .. '.'  .. given_fact_table_name .. ' (' .. factTable[1][1] .. ');'
		
		return factCreateStatements
	end
