May-07-2021, 04:02 PM
Hi, I am trying to go through filtered records and copy the contents, line by line, of field1 to field2.
Why is the field2 being filled with the same value and not it's corresponding field1 value?
Thanks.
Why is the field2 being filled with the same value and not it's corresponding field1 value?
Thanks.
import sqlite3 conn = sqlite3.connect("test.sqb") cursor = conn.cursor() sql = "SELECT * FROM report WHERE type LIKE 'E%'" cursor.execute(sql) data = cursor.fetchall() for row in data: field1 = row[0] cursor.execute("UPDATE report SET field2='" + field1 + "'") conn.commit() conn.close()