How to find bad row with db api executemany()?

Chris Angelico rosuav at gmail.com
Sat Mar 30 00:24:52 EDT 2013


On Sat, Mar 30, 2013 at 3:19 PM, Dennis Lee Bieber
<wlfraed at ix.netcom.com> wrote:
>         I think MySQL is the only common DBMS with an extension on INSERT of
> allowing multiple records (I've not checked my Access 2010 docs, and my
> MSDE/SQL-Server books are in storage -- but SQLite3, Firebird, and
> PostgreSQL all seem to be "one INSERT = one record").

I don't know about performance, but syntactically at least, an INSERT
is certainly allowed to do multiple records. I do this all the time
for database dump/recreation, something like:

INSERT INTO table (field,field,field) VALUES
(value,value,value),(value,value,value);

I've done this in PostgreSQL, and I'm pretty sure also in MySQL. That
might be identical in performance to two separate statements, but at
least it's clearer.

ChrisA



More information about the Python-list mailing list