Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I have an error handler in some Perl code which connects to SQL Server via ODBC. I have the following error handler definedI'm getting this error and wish to skip itsub 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; }
Being fairly new to Perl I'm not sure how to change the error handler to be able to ignore this particular errorDBD::ODBC::st execute failed: [Microsoft][SQL Server Native Client 11. +0][SQL Server]Arithmetic overflow error converting float to data type + numeric. (SQL-22003)
So something like if nativerr = 22003 return 0 else return 1
Any help appreciated
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: ODBC Sql Server error handling
by Laurent_R (Canon) on Aug 13, 2013 at 19:00 UTC | |
Re: ODBC Sql Server error handling
by mje (Curate) on Aug 14, 2013 at 09:13 UTC |
Back to
Seekers of Perl Wisdom