> 
> Hi!
> 
> 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?

Roger -- if you can package up a small test script which reproduces it,
that would be great.  I believe this may be a side effect of some of the
checking for "more results" and I may be missing the actual error
message somewhere along the way.  A trace file may help, also.

> 
> 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!!

That could be a few things.  There was some code in DBD::ODBC to prevent
that once upon a time, if your character (varchar) bound strings
increased in size.  That might also be another side effect of the
multiple statement handling.  I don't know SQL Server well enough to see
what's really under the hood.  A small sample of what you are doing
would help and -- if you can, tell me how to check if sp_prepare is
being called, I will look into it.

Regards,

Jeff


Reply via email to