Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'insert': 0.05; 'table.': 0.07; 'subject:How': 0.10; 'suggest': 0.14; '"insert': 0.16; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'temp': 0.16; 'wrote:': 0.18; 'load': 0.23; 'replace': 0.24; 'url:dev': 0.24; 'looks': 0.24; 'sort': 0.25; 'mention': 0.26; 'header:In-Reply-To:1': 0.27; '[1]': 0.29; 'tim': 0.29; 'chase': 0.31; 'table': 0.34; 'subject:with': 0.35; 'google': 0.35; 'doing': 0.36; 'charset:us-ascii': 0.36; 'to:addr:python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'url:5': 0.61; 'url:0': 0.67; 'received:50.22': 0.84; 'subject:find': 0.84 Date: Fri, 29 Mar 2013 22:38:08 -0500 From: Tim Chase To: python-list@python.org Subject: Re: How to find bad row with db api executemany()? (PS) In-Reply-To: <20130329221750.4b00728d@bigbox.christie.dr> References: <5155E32A.1000403@davea.name> <20130329221750.4b00728d@bigbox.christie.dr> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364614588 news.xs4all.nl 6884 [2001:888:2000:d::a6]:34637 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42309 On 2013-03-29 22:17, Tim Chase wrote: > 2) Load into a temp table in testable batches, then do some sort of > batch insert into your main table. Again, a quick google suggest > the "INSERT ... SELECT" syntax[2] It looks like there's a corresponding "REPLACE INTO ... SELECT" syntax[1], as you mention doing a REPLACE INTO rather than a straight INSERT -tkc [1] http://dev.mysql.com/doc/refman/5.0/en/replace.html