Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42247

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

From Roy Smith <roy@panix.com>
Date 2013-03-29 10:48 -0400
Subject How to find bad row with db api executemany()?
Newsgroups comp.lang.python
Message-ID <mailman.3950.1364568516.2939.python-list@python.org> (permalink)

Show all headers | View raw


I'm inserting a gazillion rows into a MySQL database using MySQLdb and cursor.executemany() for efficiency.  Every once in a while, I get a row which violates some kind of database constraint and raises Error.

I can catch the exception, but don't see any way to tell which row caused the problem.  Is this information obtainable, short of retrying each row one by one?

---
Roy Smith
roy@panix.com

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

How to find bad row with db api executemany()? Roy Smith <roy@panix.com> - 2013-03-29 10:48 -0400
  Re: How to find bad row with db api executemany()? Miki Tebeka <miki.tebeka@gmail.com> - 2013-03-30 09:24 -0700
    Re: How to find bad row with db api executemany()? Roy Smith <roy@panix.com> - 2013-03-30 12:44 -0400

csiph-web