I have some python code that looks like this
import pypyodbc
import pandas as pd
home=\"c:/SQL/\"
df = pd.read_sql_query(sql4, conn3
for y1 in range(0 , k):
In this case the correct Update statement is:
cursor.execute("""UPDATE ENCOMPASS_DIA SET CTIME=? WHERE SERNUM=?""", (SSTIME,ARCHIVE_SERNUM ))
An easy enough mistake to make.
cursor.execute("""
UPDATE ENCOMPASS_DIA
SET CTIME=%s
WHERE SERNUM=ARCHIVE_SERNUM
""", (STIME, ))
There should be a trailing ,
after the STIME
or (STIME) will be interpreted as a list instead of a tuple.