Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4985 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
zář 23
6226
3
led 20
12680
0
pro 23
8074
0
bře 15
3236
0
bře 15
3472