我正在尝试使用以下python代码
更新Postgres表(Table1)中的列for i in range(0,len(df)):
QUERY=""" UPDATE "Table1" SET "var"='%s' WHERE "Table"."id"='%s' """
% (df['sum'][i], df['id'][i])
pd.read_sql_query(QUERY,con=engine)
它抛出以下错误消息。
ResourceClosedError: This result object does not return rows. It has been closed automatically.
能告诉我如何解决这个问题吗?