Load file errors

Load file errors

am 27.02.2006 15:24:12 von Jim

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

Re: Load file errors

am 27.02.2006 18:44:48 von Bill Karwin

"Jim" wrote in message
news:1141050252.615263.39400@e56g2000cwe.googlegroups.com...
> 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.

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/en/batch-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.