Author: byterock
Date: Thu Oct 29 12:33:00 2009
New Revision: 13455

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

Log:
 Fix for rt.cpan.org Ticket #=49331 Bad code example in POD 

Modified: dbd-oracle/trunk/Changes
==============================================================================
--- dbd-oracle/trunk/Changes    (original)
+++ dbd-oracle/trunk/Changes    Thu Oct 29 12:33:00 2009
@@ -1,7 +1,8 @@
 =head1 Changes in DBD-Oracle 1.24(svn rev???)
+  Fix for rt.cpan.org Ticket #=49331 Bad code example in POD from John Scoles
   Added support for looking up OCI_DTYPE_PARAM Attributes
   Added support for looking up csform values 
-  Fix for rt.cpan.org Ticke  #=46763,46998 enhancement -Rowcache size is now 
being properly implimented with row fetch buffer from John Scoles 
+  Fix for rt.cpan.org Ticket #=46763,46998 enhancement -Rowcache size is now 
being properly implimented with row fetch buffer from John Scoles 
   Fix for rt.cpan.org Ticket #=46448 enhancement -Errors returned by 
procedures are now unicode strings from Martin Evans, John Scoles and Tim Bunce
   Fix for rt.cpan.org Ticket #=47503 bugfix - using more than 1 LOB in insert 
broken from APLA
   Fix for rt.cpan.org Ticket #=46613 bugfix - sig-abort on nested objects with 
ora_objects=1 from TomasP

Modified: dbd-oracle/trunk/Oracle.pm
==============================================================================
--- dbd-oracle/trunk/Oracle.pm  (original)
+++ dbd-oracle/trunk/Oracle.pm  Thu Oct 29 12:33:00 2009
@@ -2212,20 +2212,25 @@
 
     my $sth=$dbh->prepare( $statement );
 
-    my @arr=( "abc" );
+    my @arr=( "abc","efg","hij" );
 
-    $sth->bind_param_inout(":mytable", \...@arr, 10, {
+    $sth->bind_param_inout(":mytable", \...@arr, 10, {
             ora_type => ORA_VARCHAR2_TABLE,
             ora_maxarray_numentries => 100
-    } ) );
-    $sth->bind_param_inout(":cc", \$cc, 100 ) );
+    } ) ;
+    $sth->bind_param_inout(":cc", \$cc, 100  );
     $sth->execute();
     print      "Result: cc=",$cc,"\n",
        "\tarr=",Data::Dumper::Dumper(\...@arr),"\n";
 
+N.B. 
+
+   Take careful note that we use '\...@arr' here because  the 
'bind_param_inout'
+   will only take a reference to a scalar. 
+ 
 =over
 
-=item OCI_VARCHAR2_TABLE
+=item ORA_VARCHAR2_TABLE
 
 SYS.DBMS_SQL.VARCHAR2_TABLE object is always bound to array reference.
 ( in bind_param() and bind_param_inout() ). When you bind array, you need
@@ -2245,7 +2250,7 @@
 array length is used as maximum. If 0 < I<ora_maxarray_numentries> < 
scalar(@array),
 not all array entries are bound.
 
-=item OCI_NUMBER_TABLE
+=item ORA_NUMBER_TABLE
 
 SYS.DBMS_SQL.NUMBER_TABLE object handling is much alike ORA_VARCHAR2_TABLE.
 The main difference is internal data representation. Currently 2 types of
@@ -2285,7 +2290,7 @@
     @arr=( 1,"2E0","3.5" );
     
     # note, that ora_internal_type defaults to SQLT_FLT for ORA_NUMBER_TABLE .
-    if( not $sth->bind_param_inout(":mytable", \...@arr, 10, {
+    if( not $sth->bind_param_inout(":mytable", \...@arr, 10, {
                     ora_type => ORA_NUMBER_TABLE,
                     ora_maxarray_numentries => (scalar(@arr)+2),
                     ora_internal_type => SQLT_FLT

Reply via email to