Hi Everybody,
I have a function with a new improved version of the code for automatic table indexing:
def update_tableIndex(self,tableName):
getIndexMySQLQuery = """SELECT numberID
FROM %s;""" % (tableName,)
updateIndexMySQLQuery = """UPDATE %s
SET numberID=%s WHERE numberID=%s;""" % (tableName,)
updateIndex=1
self.cursorMySQL.execute(getIndexMySQLQuery)
for row in self.cursorMySQL:
indexID = row[0]
self.cursorMySQL.execute(updateIndexMySQLQuery,(updateIndex,indexID))
updateIndex+=1
While the query 'getIndexMySQLQuery' works fine with this syntax, the other one 'updateIndexMySQLQuery' doesn't work.
Any hints or suggestion how to get that fixed?
All comments and suggestions are highly appreciated.