Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5036 มุมมอง

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))
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ย. 23
6272
3
ม.ค. 20
12725
0
ธ.ค. 23
8150
0
มี.ค. 15
3282
0
มี.ค. 15
3526