What do I need?
I have SQL content like:
('a', 1),
So I do:
return_string = '('
for column in columns:
return_string += "'" + column + "', "
return_string = return_string[:-2] + '),'
return return_string
But it fails with the same error.
>>> a = 'a'
>>> a + 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cannot concatenate 'str' and 'int' objects
>>> 1 + "1"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'
>>>
However, if I convert an int into a string, everything works and I get:
('a', '1'),
But I need
('a', 1),
where 1 is unquoted '