DBD::ODBC extended error information
- From: Surlygman@xxxxxxxxx
- Date: 28 Feb 2006 10:12:37 -0800
How do I get the extended error information utilizing DBD::ODBC?
MSSQL seems to return several levels of error information, however the
$DBI::errstr only contains the first one.
I am using Perl 5.8.0 on windows with DBI and DBD::ODBC. I have a high
thruput script that I am trying to utilize the odbc_exec_direct
attribute for.
I prepare and exec raw SQL like so:
my $statementHandle = $gDBConn->prepare($sql);
if(not ($statementHandle->execute()))
{
$error = $DBI::errstr;
When I turn on the odbc_exec_direct attr, any statement that fails (and
previously would return the appropriate error message) now returns:
[Microsoft][ODBC SQL Server Driver]Associated statement is not prepared
(SQL-HY007)(DBD: dbd_describe/SQLNumResultCols err=-1)
I believe that the error information that I need is the next one
returned (i.e., SQL-23000, cannot insert dupe row), however I have not
found out how to 'drill down' thru the errors.
Thanks,
G
.
- Prev by Date: Re: Connect to Oracle
- Next by Date: building DBD::Oracle 1.17 with 64 bit perl588 on AIX 5.1
- Previous by thread: RE : Can't connect to Sybase Rep server
- Next by thread: building DBD::Oracle 1.17 with 64 bit perl588 on AIX 5.1
- Index(es):