Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
5034 Visninger

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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
0
sep. 23
6268
3
jan. 20
12725
0
dec. 23
8139
0
mar. 15
3282
0
mar. 15
3526