Re: MySQLdb

Discussion in 'Python' started by Swaroop C H, Jan 25, 2005.

  1. Swaroop C H

    Swaroop C H Guest

    > >I think a better option is to have the rows in a text file and then
    > >use `mysqlimport` or 'load data infile' SQL[1]
    > >
    > >[1]: http://dev.mysql.com/doc/mysql/en/load-data.html
    > >

    > I remember using that a while ago when I dabbled with mysql so I think
    > thats a potential solution. With my current solution I get full error
    > logging with each row i try to insert. Will mysqlimport fail completeley
    > if one row fails?


    I've not yet encountered an error using mysqlimport. But the docs at
    that link say that it might fail completely depending on the type of
    error.

    Excerpt:
    " If you specify IGNORE, input rows that duplicate an existing row on
    a unique key value are skipped. If you don't specify either option,
    the behavior depends on whether or not the LOCAL keyword is specified.
    Without LOCAL, an error occurs when a duplicate key value is found,
    and the rest of the text file is ignored. With LOCAL, the default
    behavior is the same as if IGNORE is specified; this is because the
    server has no way to stop transmission of the file in the middle of
    the operation.
    "

    P.S. Its best to take this discussion off the list since its not
    directly related to Python.

    --
    Swaroop C H
    Blog: http://www.swaroopch.info
    Book: http://www.byteofpython.info
     
    Swaroop C H, Jan 25, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alan Little

    can't import MySQldb on OS X

    Alan Little, Jun 25, 2003, in forum: Python
    Replies:
    0
    Views:
    860
    Alan Little
    Jun 25, 2003
  2. Skip Montanaro

    Re: Problem with MySQLdb on Mac OS X...

    Skip Montanaro, Jul 12, 2003, in forum: Python
    Replies:
    5
    Views:
    400
    Michael S. Jessop
    Jul 16, 2003
  3. Mike M
    Replies:
    1
    Views:
    354
  4. Dave Harrison

    MySQLdb and egenix mxDateTime dumps core

    Dave Harrison, Aug 5, 2003, in forum: Python
    Replies:
    0
    Views:
    353
    Dave Harrison
    Aug 5, 2003
  5. Dave Harrison

    using like and % in MySQLdb

    Dave Harrison, Aug 7, 2003, in forum: Python
    Replies:
    0
    Views:
    329
    Dave Harrison
    Aug 7, 2003
Loading...

Share This Page