while( my $data = $dbh->ora_lob_read( $char_locator, $offset, $chunk_size ) ) {
print STDOUT $data;
$offset += $chunk_size;
}you will miss this last byte as $data will contain 0. As the data I'm interested is compressed, this causes it to be corrupted and so my code barfs later on.
I've attached a simple patch against DBD::Oracle 1.22. Cheers, Chris,
+++ Oracle.pm 2008-09-22 11:56:56.000000000 +0100
--- Oracle.pm.orig 2008-09-22 11:55:53.000000000 +0100
@@ -3549,9 +3549,7 @@
my $chunk_size = 1034; # Arbitrary chunk size, for example
my $offset = 1; # Offsets start at 1, not 0
+ while(1) {
+ my $data = $dbh->ora_lob_read( $char_locator, $offset, $chunk_size );
+ last unless length $data;
- while( my $data = $dbh->ora_lob_read( $char_locator, $offset, $chunk_size )
) {
print STDOUT $data;
$offset += $chunk_size;
}
signature.asc
Description: OpenPGP digital signature
