Skip to Content
Menu
This question has been flagged
1 Reply
3972 Views

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
Avatar
Discard
Best Answer

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))
Avatar
Discard
Related Posts Replies Views Activity
0
Sep 23
5180
3
Jan 20
11400
0
Dec 23
6939
0
Mar 15
2504
0
Mar 15
2578