跳至内容
菜单
此问题已终结
1 回复
4597 查看

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
5782
3
1月 20
12277
0
12月 23
7628
0
3月 15
2916
0
3月 15
3038