column_name:value としてデータを含む Python スクリプトに辞書があり、これから update ステートメントを作成したいと考えています。私はpython 3.3とcx-oracleを使用しています。この答えを見つけました: How to update mysql with python where fields and entries are from a dictionary?
そしてそれを次のように使用しました:
SQL = 'UPDATE scheme SET {}'.format(', '.join('{}=%s'.format(k) for k in schemes_dict))
cursor.execute(SQL, schemes_dict.values())
しかし、次のエラーが発生します:
TypeError: expecting a dictionary, sequence or keyword args
私はグーグルで読んでいますが、それを機能させる方法が見つかりません。誰でも助けることができますか?