【问题标题】:multiple parameters for psycopg2 where clausepsycopg2 where 子句的多个参数
【发布时间】:2016-03-04 07:07:04
【问题描述】:

我正在尝试运行 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)

【问题讨论】:

  • 您收到什么错误信息?请编辑问题以包含该信息。
  • 我觉得应该是execution_code IS NULL
  • @bernie 就是这样。谢谢。

标签: psycopg2


【解决方案1】:

应该是:

execution_code IS NULL
--             ^^

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多