Fixed sql statement syntax errors induced by new lines