I am trying to create an SQL database table and insert some data ("mask_id" below). I am receiving the error sqlite3.OperationalError near ")": syntax error that is referring to the last line (row['MASKID'],)). Specifically, I am trying to read a CSV file and insert data from the 'MASKID' column into my database.
I am unable to troubleshoot and would appreciate some help.
cur.execute('''CREATE TABLE IF NOT EXISTS subj_list (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, mask_id TEXT)''')
with open('/Users/Leo/Desktop/bp.csv', 'rU') as bp_csv:
bp_reader = csv.DictReader(bp_csv)
count = 0
for row in bp_reader:
cur.execute('INSERT OR IGNORE INTO subj_list (mask_id,) VALUES (?,)' (row['MASKID'],))
cur.execute('INSERT OR IGNORE INTO subj_list (mask_id) VALUES (?)' , (row['MASKID'],))