[svn:dbd-oracle] r12054 - dbd-oracle/trunk

[email protected]
Newsgroups perl.dbd.oracle.changes
Message-ID <[email protected]>
Author: byterock
Date: Thu Nov  6 12:12:08 2008
New Revision: 12054

Modified:
   dbd-oracle/trunk/Changes
   dbd-oracle/trunk/Oracle.pm

Log:
 Update to POD from Chris Underhill
  

Modified: dbd-oracle/trunk/Changes
==============================================================================
--- dbd-oracle/trunk/Changes	(original)
+++ dbd-oracle/trunk/Changes	Thu Nov  6 12:12:08 2008
@@ -1,4 +1,5 @@
 =head1 Changes in DBD-Oracle 1.23(svn rev #####)
+  Update to POD from Chris Underhill
   Added README.win64.txt with content from Alex Buttery
   Fix for rt.cpan.org Ticket #=21920 Bug with Oracle DBD for Mac OS X Instant Client From boingolover
   Added a few more constants to get rid of magic numbers from John Scoles

Modified: dbd-oracle/trunk/Oracle.pm
==============================================================================
--- dbd-oracle/trunk/Oracle.pm	(original)
+++ dbd-oracle/trunk/Oracle.pm	Thu Nov  6 12:12:08 2008
@@ -3568,7 +3568,9 @@
 
    my $chunk_size = 1034;   # Arbitrary chunk size, for example
    my $offset = 1;   # Offsets start at 1, not 0
-   while( my $data = $dbh->ora_lob_read( $char_locator, $offset, $chunk_size ) ) {
+   while(1) {
+      my $data = $dbh->ora_lob_read( $char_locator, $offset, $chunk_size );
+      last unless length $data;
       print STDOUT $data;
       $offset += $chunk_size;
    }
@@ -3579,6 +3581,18 @@
 the select statement does not require the "FOR UPDATE"
 clause.
 
+A word of catution when using the data retruned from an ora_lob_read in a condtional statement. 
+for example if the code below;
+
+   while( my $data = $dbh->ora_lob_read( $char_locator, $offset, $chunk_size ) ) {
+        print STDOUT $data;
+        $offset += $chunk_size;
+   }
+   
+was used with a chunk size of 4096 against a blob that requires more than 1 chunk to return 
+the data and the last chunk is one byte long and contains a zero (ASCII 48) you will miss this last byte
+as $data will contain 0 which PERL will see as false and not print it out.
+
 =head3 Example: Truncating existing large data
 
 In this example, we truncate the data already present in a
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.