First question: when you're writing out the images to the file handle, are you setting binmode on the file handle? Some operating systems have a lovely habit of truncating files on the first CTRL-Z character they see -- not that you've told us what operating system you're running your program on.
That looks like code directly from the Perl sample 'dtlob.pl' included with DB2 for Linux, UNIX, and Windows in the ~/sqllib/samples/perl/ directory (visible online in the DB2 Information Center)
Have you tried running that sample program against the DB2 SAMPLE database (created with the db2sampl command)? If the sample program works, then the problem is either with your application, your database schema, or your builds of DBI (current version 1.46) or DBD::DB2 (current version 0.78).
Are you connecting to a DB2 for Linux, UNIX, and Windows database server, or to a DB2 for iSeries or zSeries server?
To really assist you, you need to give us more information.
Note that the DBD::DB2 driver is officially supported by IBM, so you can open a PMR (problem report) if you have a support contract for DB2 with IBM. Of course, you'll need to provide much more information than you've provided here.
|