Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4989 Vizualizări

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
Imagine profil
Abandonează
Cel mai bun răspuns

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))
Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
sept. 23
6236
3
ian. 20
12687
0
dec. 23
8079
0
mar. 15
3236
0
mar. 15
3482