Re: truncated data after INSERT with undef in DBI - bug?

From: Brian McCauley (nobull_at_mail.com)
Date: 03/17/04


Date: 17 Mar 2004 19:08:35 +0000


"iain" <irhm@clara.net> writes:

> With DBI and SQL Server ODBC driver I have prepared an INSERT statement with
> placeholders. But if the first execute has a undef (aka NULL), the execute
> for the following row is truncated to just the first character for the same
> field.
>
> Has anyone else found this, or got a workaround? Is it a problem with DBI,
> the DBD::ODBC driver or the SQL Server ODBC driver or SQL Server itself?

I've run your test script here and not reproduced the problem with:
  perl5.8.0 (ActiveState 806).
  DBI 1.37
  DBD::ODBC 1.05
  SQL server ODBC driver 2000.81.9042.00
  odbc32.dll,odbccp32.dll 3.520.9042.0
  odbccr32.dll,odbccu32.dll 3.520.9030.0
  SQL server 8.00.534 (SP2)

In addition to DBI tracing options mentioned by someone else you may
also want to trace the SQL server using the SQL Profiler tool.

I've experienced equally strnage problems on SQL servers lacking SP2.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\