跳至內容
選單
此問題已被標幟
1 回覆
4977 瀏覽次數

res = [(9999, 20109), (10000, 20110)]

self.env.cr.execute("""INSERT INTO magic_res_partner (magic_uniq_id, magic_customer_number) VALUES
%s """, tuple(res))



Error is %s
ERROR: not all arguments converted during string formatting


any solution
頭像
捨棄
最佳答案

Hello,

Inserting two values so two times use %s, %s  and res contains list of tuple so iterate in for loop and insert value one by one.

Example,

res = [(9999, 20109), (10000, 20110)]
for r in res:
    self.env.cr.execute("""INSERT INTO magic_res_partner (magic_uniq_id, magic_customer_number) VALUES (%s, %s) """,     tuple(r))
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
9月 23
6220
3
1月 20
12672
0
12月 23
8065
0
3月 15
3233
0
3月 15
3460