Load file errors

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim

    #1

    Load file errors

    Hi,

    I am looking into writing many sql statements to a file and then
    executing those all at once. I am using perl in windows to create the
    insert statements and then need to load the data into a Unix Mysql DB.
    Would like to do the insert from the windows side using perl and ODBC,
    but it maybe much faster to do from Unix that it would be the better
    way to go.

    What command would I use and if a single statement were wrong, how
    would the DB or script respond.

    Thank you for any guidance.

    Jim

  • Bill Karwin

    #2
    Re: Load file errors

    "Jim" <jferree@gmail. com> wrote in message
    news:1141050252 .615263.39400@e 56g2000cwe.goog legroups.com...[color=blue]
    > I am looking into writing many sql statements to a file and then
    > executing those all at once.
    >
    > What command would I use and if a single statement were wrong, how
    > would the DB or script respond.[/color]

    The 'mysql' command-line tool is the best for this.
    http://dev.mysql.com/doc/refman/5.0/en/mysql.html

    Specifically, read these pages:
    http://dev.mysql.com/doc/refman/5.0/en/batch-mode.html
    http://dev.mysql.com/doc/refman/5.0/...-commands.html

    There is also a "-f" option that causes the execution to continue if any SQL
    errors are encountered. The default behavior is to abort when it receives
    an error.

    Regards,
    Bill K.


    Comment

    Working...