So, I have the following issue when updating my database:
I have a column in my table that I need to split in three essentially and so I have the following code:
with con:
cur = con.cursor()
cur.execute('SELECT Column1 FROM MainTable')
while True row = cur.fetchone()
if row == None:
break
for line in row: a, b, c= line.split('-')
print (b);
which gives me the values of the second column for instance. However, I need to UPDATE that second column with those values and for this I have tried adding the following at the bottom:
cur.execute('UPDATE MainTable SET Col_2 = ?' WHERE Id = 1, (row, Id))
con.commit()
However, for some reason this isn't running well.