Author: byterock
Date: Fri Apr 23 12:45:43 2010
New Revision: 13928

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

Log:
 Patch for PL/SQL: numeric or value error: character string buffer too small 
from Scott T. Hildreth
 

Modified: dbd-oracle/trunk/Changes
==============================================================================
--- dbd-oracle/trunk/Changes    (original)
+++ dbd-oracle/trunk/Changes    Fri Apr 23 12:45:43 2010
@@ -1,5 +1,6 @@
 =head1 Changes in DBD-Oracle 1.25(svn rev #####)
-
+  
+  Patch for PL/SQL: numeric or value error: character string buffer too small 
from Scott T. Hildreth
   Fix for rt.cpan.org Ticket #=51594 type_info and type_info_all miss vital 
information from John Scoles
   Added ora_lob_is_init function by John Scoles
   Fix for rt.cpan.org Ticket #=55031 Ubuntu Server  Building with Oracle XE 
under 32-bit from Brian Candler 

Modified: dbd-oracle/trunk/Oracle.pm
==============================================================================
--- dbd-oracle/trunk/Oracle.pm  (original)
+++ dbd-oracle/trunk/Oracle.pm  Fri Apr 23 12:45:43 2010
@@ -836,8 +836,13 @@
        my $sth = $dbh->prepare_cached("begin dbms_output.get_line(:l, :s); 
end;")
                or return;
        my ($line, $status, @lines);
+       my $version = join ".", @{ ora_server_version($dbh) }[0..1];
+       my $len =  32767;
+       if ($version < 10.2){
+           $len = 400; 
+       }
        # line can be greater that 255 (e.g. 7 byte date is expanded on output)
-       $sth->bind_param_inout(':l', \$line,  400, { ora_type => 1 });
+       $sth->bind_param_inout(':l', \$line, $len, { ora_type => 1 });
        $sth->bind_param_inout(':s', \$status, 20, { ora_type => 1 });
        if (!wantarray) {
            $sth->execute or return undef;

Reply via email to