A
anton.ranieri.it
Hi,
I'd like to insert Multiple Records Using One Insert Statement
inserting one record using one insert statement works
this is the example:
import MySQLdb
conn = MySQLdb.connect(host="localhost",.....)
cursore = conn.cursor()
cursore.execute('INSERT INTO frutta (nome, quantita) VALUES(%s, %s)',
('Pompelmi', 10)
)
but when I try to insert Multiple Records Using One Insert Statement
in this way:
cursore.execute('INSERT INTO frutta (nome, quantita) VALUES(%s, %s)',
('Pompelmi', 10),
('Pompelmi', 10),
('Pompelmi', 10)
)
it doesn't work!
Antonella
I'd like to insert Multiple Records Using One Insert Statement
inserting one record using one insert statement works
this is the example:
import MySQLdb
conn = MySQLdb.connect(host="localhost",.....)
cursore = conn.cursor()
cursore.execute('INSERT INTO frutta (nome, quantita) VALUES(%s, %s)',
('Pompelmi', 10)
)
but when I try to insert Multiple Records Using One Insert Statement
in this way:
cursore.execute('INSERT INTO frutta (nome, quantita) VALUES(%s, %s)',
('Pompelmi', 10),
('Pompelmi', 10),
('Pompelmi', 10)
)
it doesn't work!
Antonella