in reply to Can I get the actual error for DBI->execute() ?

My (un)educated guess is the command immediately preceding the failing one.

Perhaps a stray quote or backslash in one of the $celldata or something like this -- think bobby tables 😉

Replies are listed 'Best First'.
Re^2: Can I get the actual error for DBI->execute() ?
by SergioQ (Scribe) on Jun 21, 2024 at 17:42 UTC

    Perhaps a stray quote or backslash in one of the $celldata or something like this -- think

    A stray quote was exactly the issue, and I have taken care of that. But I would still like to catch any errors, without dying, reporting themm back to the enduser, and then exit the script gracefully.

      I'm surprised nobody else came right out and said this yet: Your code is vulnerable to SQL injection. You should never interpolate Perl variables into SQL because DBI gives you a placeholder system that solves the problem the right way. Write your query with "?" for each value and then plug the values into the execute call.
      You have RaiseError => 0. Set it to 1 and wrap it in an eval. I'd also recommend using placeholders instead of interpolating variables in strings.