I have a Perl program that writes binary data to a SQL Server image
field (column of type image) using DBD::ODBC.

This works fine in Perl 5.8.8 (ActivePerl build 822)
($DBD::ODBC::VERSION = '1.13';) I am using Windows XP and SQL Server
2005 and using the "SQL Server" ODBC driver).

However, there are two problems with build 824 with an upgraded ODBC
or with ActivePerl 5.10.0 build 1004. (dbd::odbc version 1.18)

First - data written to the image field is being truncated, i.e. not
all of the data shows up in the database. Writing the data to a file
at the same time as writing to the database shows that program is
still generating the data correctly, so the fault is with DBI or
DBD::ODBC. The data is built with pack, so the UTF-8 flag shouldn't be
a problem.

Second - on reading the data, ODBC thinks the size is longer than it
actually is and gives me right truncation errors unless I increase the
long read length by a factor of 10.

Does anyone have any clue as to what might be happening here for me.
Any help would really be appreciated.

For the example I am having problems with, the data is about 600K in
size.

Thanks
Horace

Reply via email to