Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'insert': 0.05; 'postgresql': 0.07; 'mysql.': 0.09; 'performs': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:How': 0.10; 'creates': 0.14; 'books': 0.15; '(it': 0.16; 'dump': 0.16; 'guys,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'statements,': 0.16; 'sat,': 0.16; 'select': 0.22; 'load': 0.23; 'documented': 0.24; 'url:home': 0.24; 'equivalent': 0.26; 'extension': 0.26; 'header:X -Complaints-To:1': 0.27; 'chris': 0.29; 'external': 0.29; 'matching': 0.30; 'especially': 0.30; 'usually': 0.31; 'loads': 0.31; 'table,': 0.31; 'file': 0.32; 'checked': 0.32; 'table': 0.34; 'subject:with': 0.35; 'common': 0.35; 'but': 0.35; 'charset :us-ascii': 0.36; 'received:76': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'finally': 0.65; 'mar': 0.68; 'book,': 0.68; 'records': 0.73; '"hey,': 0.84; '"one': 0.84; 'differently:': 0.84; 'subject:find': 0.84; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: How to find bad row with db api executemany()? Date: Sat, 30 Mar 2013 00:19:43 -0400 Organization: > Bestiaria Support Staff < References: <5155E32A.1000403@davea.name> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-26-43.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364617199 news.xs4all.nl 6858 [2001:888:2000:d::a6]:56660 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42316 On Sat, 30 Mar 2013 13:49:56 +1100, Chris Angelico declaimed the following in gmane.comp.python.general: > Especially facepalm because there's some way to do this that's faster > than straight INSERT statements, and it's not clearly documented as > "hey, guys, if you want to dump loads of data in, use COPY instead" > (it might be that, I don't know, but usually COPY isn't directly > transliterable with INSERT). > While COPY is found in my ancient PostgreSQL book, I don't find it in MySQL. I suspect the equivalent is LOAD DATA INFILE. Firebird goes completely differently: one does a CREATE TABLE exttable EXTERNAL FILE "fixed-length.txt" (table definition), then creates a matching internal table, and finally performs an INSERT INTO internal SELECT fields FROM exttable. 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"). -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/