I am trying to iterate through each row in my database and edit a single column for each of them. The column is called "name" (a varchar) and it is in the company table.
I am trying to remove the commas and then update it in my database.
So far what I have is this:
cursor = db.cursor()
companynames = cursor.execute("SELECT name FROM company;")
for row in cursor:
row.replace(",", "")
This does not work properly.
print row returns ('Syntel, Inc. ',) ... A tuple
What can I do to properly retrieve the varchar field and then update it? `