UPDATE: How do I specify that the first item in my list should be used to update the first row of the column and so on, until the end of the list (which contains the name number of items as there are rows in the column)?
sc_id = 1
for x in generator_list:
c.execute('UPDATE breakdown SET characters = ?
WHERE rowid = sc_id', x)
sc_id += 1
gives the error: sqlite3.OperationalError: no such column: sc_id
PREVIOUS QUESTION:
Why when I executemany UPDATE a column in SQLite3 it writes the last row to all rows?
I'm using :
c.executemany('UPDATE breakdown SET characters = ?', generator_list)
generator_list is constructed by:
generator_expression = ((val,) for val in updated_local_sc_char_lists)
generator_list = list(generator_expression)
updated_local_sc_char_lists = ['1-HARPER, RORY, THOMAS', 'AUGUST, THOMAS']
generator_list = [('1-HARPER, RORY, THOMAS',), ('AUGUST, THOMAS',)]
After I execute UPDATE and query selectall it returns:
[('AUGUST, THOMAS',), ('AUGUST, THOMAS',)]