in reply to DBI - check erroneous statement?

Are you not checking the return status?

my $rv = $sth->execute() or die $sth->errstr;

This should throw an error and indicate where the problem with the SQL is.

Update: For more information see the DBI documentation.

Replies are listed 'Best First'.
Re^2: DBI - check erroneous statement?
by DreamT (Pilgrim) on Nov 19, 2010 at 16:08 UTC
    Ok, but that gives me only a hint of where the problem can be ("check the manual that corresponds to your MySQL server version for the right syntax to use near"). Is it possible to see the entire statement?

      DBD::Oracle displays the SQL and points out where it thinks the error is. Perhaps look at DBD::mysql (search for RaiseError => 1) or the DBI documentation on Tracing.

      Can't you just examine $sth->{Statement}? See Statement