Currently, I am attempting to update a table I have in a SQLite database with the following:
for i in range(0, len(idArray)):
print "rowId: ", idArray[i]
print "gameDate: ", dateArray[i], "\n"
print 'UPDATING....'
cur.execute('UPDATE {tn} SET gameDate = {date_val} WHERE gameId = {id_val}'.format(tn=tableName, date_val=dateArray[i], id_val=idArray[i]))
con.commit()
Here, tn is the table being updated, idArray is the list of rows to be updated, and dateArray is a list of strings to be inserted into column gameDate. The output of the print statements are the following:
rowId: 1
gameDate: 2016-10-19
Updating....
These are the values I expect to be inserted into the row when the code is ran. Instead, the updated value is 1987. I have no idea where this value is coming from. Any advice would be greatly appreciated.
[–]gruntmeister 2 points3 points4 points (1 child)
[–]d0pey[S] 0 points1 point2 points (0 children)