List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:October 5 2007 12:14pm
Subject:Re: Debugging batch sql statements
View as plain text  
Arun wrote:
> I have a large batch of insert sql statements, of which some of them are
> failing. I want to know which one is failing exactly.
> Is there anyway I can debug it  and which statement went wrong. I have only
> 4 or 5 out of 200 statements that are failing.
> 
It depends on how you're running the batch, and you didn't give us any 
information about that.  Are you doing something like this?

mysql < batch.sql

If so, try

mysql --line-numbers < batch.sql

This option may be enabled already.  Try running mysql --help | grep 
'line-numbers' to see.  It's enabled by default on my machine:

baron@kanga:~$ mysql --help | grep 'line-numbers'
   --line-numbers      Write line numbers for errors.
   -L, --skip-line-numbers
line-numbers                      TRUE

Baron
Thread
Debugging batch sql statementsArun5 Oct
  • Re: Debugging batch sql statementsBaron Schwartz5 Oct
    • Re: Debugging batch sql statementsArun5 Oct
      • Re: Debugging batch sql statementsJørn Dahl-Stamnes5 Oct
    • Re: Debugging batch sql statementsArun5 Oct