I just noticed that I receive "better" error messages with DBD-ODBC 0.28 and DBI 1.14 compared to DBD-ODBC 1.00 and DBI 1.32
With the old versions I get this generated by $sth->execute():
DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver][SQL Server]Subquery returned more than 1 value. This is not permitted when
the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. (SQL-21000)(DBD: st_execute/SQLExecute err=-1) at
E:\Inetpub\DsmlSync\Perl\Import_011111.pl line 611.
With the newer versions I get this generated by $sth->fetchrow_arrayref():
DBD::ODBC::st fetchrow_arrayref failed: [Microsoft][ODBC SQL Server Driver]Function sequence error (SQL-HY010)(DBD: st_fetch/SQLFetch err=-1) at D:\Inetpub\wwwroot\DsmlSync_dev\Perl\Import_011111.pl line 613.
This is the relevant part of the code (with line numbers): 611: $sth->execute(); 612: 613: my $tempRef = $sth->fetchrow_arrayref();
I might be totally wrong here, the results are from two different machines with different SQL Server service packs and I haven't made any thorough investigation. I just noticed how much better the error code is with the older versions. Is it possible to get the same level of information in the newer versions?
I just noticed something a bit more serious, the older versions makes one call to sp_prepare but the newer versions makes a call to sp_prepare for *each* call of $sth->execute(). The newer versions doesn't fully benefit from prepared statements!!
Thanks Roger P
