Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
4924 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
0
sept. 23
6182
3
janv. 20
12633
0
déc. 23
8002
0
mars 15
3197
0
mars 15
3400