psycopg2 where子句的多个参数

时间:2016-03-03 23:00:22

标签: psycopg2

我试图运行executemany命令,但我无法让我的表格更新。当我在WHERE CLAUSE中有一个参数时,我能够让它工作,但现在我有多个参数,表无法更新。

cur.executemany("""UPDATE orders SET (invested_amount, ex_order_id, \
                time_acknowledged, execution_code) = \
                (%(invested_amount)s, %(instruct_id)s, current_timestamp, \
                %(execution_code)s) WHERE loan_id = %(loan_id)s and \
                requested_amount = %(requested_amount)s and execution_code = NULL""",
                order_list)

1 个答案:

答案 0 :(得分:0)

应该是:

execution_code IS NULL
--             ^^