May-24-2018, 02:56 PM
(May-24-2018, 02:46 PM)Larz60+ Wrote: Ok, Add the print statement here:
for m,n in zip(newColumnsNames, data): sqlstr = "INSERT INTO {tn} {cn} VALUES {vn}".format(tn=tableName, cn=m, vn= n)) print('sqlstr: {}'.format(sqlstr)) c.execute(sqlstr) # c.execute("INSERT INTO {tn} {cn} VALUES {vn}"\ # .format(tn=tableName, cn=m, vn= n))
Aha, that's what I got, but I still don't understand what the problem is:
Runtime error (SyntaxErrorException): unexpected token ')'
File "", line 32
sqlstr = "INSERT INTO {tn} {cn} VALUES {vn}".format(tn=tableName, cn=m, vn= n))
^
SyntaxError: unexpected token ')'