Hi
I have an error handler in some Perl code which connects to SQL Server via ODBC.
I have the following error handler defined
sub ErrorHandler {
my ($sqlstate, $msg, $nativeerr) = @_;
# Strip out all of the driver ID stuff
$msg =~ s/^(\[[\w\s:]*\])+//;
print $msg;
print "===> state: $sqlstate msg: $msg nativeerr: $nativeerr\n";
return 1;
}
I'm getting this error and wish to skip it
DBD::ODBC::st execute failed: [Microsoft][SQL Server Native Client 11.
+0][SQL Server]Arithmetic overflow error converting float to data type
+ numeric. (SQL-22003)
Being fairly new to Perl I'm not sure how to change the error handler to be able to ignore this particular error
So something like if nativerr = 22003 return 0 else return 1
Any help appreciated
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.