【发布时间】:2018-05-26 15:57:14
【问题描述】:
我想更新一个表(TEMP):
value = 100 * 0.9
statement = 'update temp set tax = :1 where name = :2'
cur.execute(statement, ('value', 'emp1'))
con.commit()
还有其他方法可以动态更新表格吗?
【问题讨论】:
-
有(无限?)许多方法可以做任何事情。你到底在问什么?
-
表格没有以这种方式更新!我正在尝试更新
-
如果不使用python直接将
update temp set tax = 'value' where name = 'emp1'; commit;写入数据库是否更新?如果不是,那么你的问题不在 python 中。