in reply to Capturing SQL errors in Perl
Aside from the best practices that have already been suggested, and that you should follow, there is one thing that at first glance indicate a point of failure. You are trying to build your query based on the values that those $a_* variables have. But you are passing them inside single quotes, and what goes inside single quotes is not interpolated. So, what you are really trying to insert is what you actually can read on that line of code, not the values of the variables.
Also, instead of the custom error message, use the one DBI gives you with DBI->errtsr
update: Thanks Crackers2 and Narveson, you are absolutely right. Please ignore this post.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Capturing SQL errors in Perl
by Crackers2 (Parson) on Apr 17, 2008 at 18:11 UTC | |
|
Re^2: Capturing SQL errors in Perl
by Narveson (Chaplain) on Apr 17, 2008 at 18:13 UTC |