Index: Changes =================================================================== --- Changes (revision 6867) +++ Changes (working copy) @@ -1,10 +1,16 @@ +=head1 Changes in DBD-Oracle 1.19 + + Changed execute_array so it returns tuples executed instead or + rows affected as per DBI spec. + Added array context support to execute_array + =head1 Changes in DBD-Oracle 1.18 (scn rev 6697) Added support for native Oracle Array interface thanks Kristian Nielsen - Added suppot for LOB Locators from Jeffrey Klein. + Added support for LOB Locators from Jeffrey Klein. Updated README.win32.txt for Oracle 10xe and new Visual C++ version - Updated README.lunix.txt for work-araound for UTF8 bug - Fixed a number of compile warings + Updated README.linux.txt for work-around for UTF8 bug + Fixed a number of compile warnings please enjoy. Index: Oracle.pm =================================================================== --- Oracle.pm (revision 6867) +++ Oracle.pm (working copy) @@ -6,7 +6,7 @@ require 5.003; -$DBD::Oracle::VERSION = '1.18'; +$DBD::Oracle::VERSION = '1.19'; my $ORACLE_ENV = ($^O eq 'VMS') ? 'ORA_ROOT' : 'ORACLE_HOME'; @@ -835,6 +835,7 @@ sub execute_for_fetch { my ($sth, $fetch_tuple_sub, $tuple_status) = @_; my $row_count = 0; + my $tuple_count=0; my $batch_size = ($sth->{ora_array_chunk_size} ||= 1000); my $tuple_batch_status; @@ -857,10 +858,15 @@ } else { $row_count = undef; } + $tuple_count+=@$tuple_batch_status; push @$tuple_status, @$tuple_batch_status if defined($tuple_status); } - return $row_count; + if (!wantarray) { + return undef if !defined $row_count; + return $tuple_count; + } + return (defined $row_count ? $tuple_count : undef, $row_count); } } @@ -988,7 +994,7 @@ # - or - $dbh = DBI->connect('dbi:Oracle:','scott/tiger'); -Refer to your Oracle documentatiion for valid values of TWO_TASK. +Refer to your Oracle documentation for valid values of TWO_TASK. Here are some variations (not setting TWO_TASK) in order of preference: @@ -1094,7 +1100,7 @@ my $dbuser = "xxx"; my $dbpass = "xxx"; my $dbh = DBI->connect("dbi:Oracle:$dbname", $dbuser, $dbpass) - || die "Unale to connect to $dbname: $DBI::errstr\n"; + || die "Unable to connect to $dbname: $DBI::errstr\n"; =head2 Oracle utilities @@ -1108,7 +1114,7 @@ same. It should include at least "IPC Protocol Adapter" and "TCP/IP Protocol Adapter". -If it generates any errors which look relevant then please talk to yor +If it generates any errors which look relevant then please talk to your Oracle technical support (and not the dbi-users mailing list). Thanks. Thanks to Mark Dedlow for this information. @@ -1145,7 +1151,7 @@ (8.1, 9.2, 10.0 etc). But note that version numbers are not actually floating point and so if Oracle ever makes a release that has a two digit minor version, such as C<9.10> it will have a lower numeric -value than the preceeding C<9.9> release. So use with care. +value than the preceding C<9.9> release. So use with care. The contents and format of ORA_OCI are subject to change (it may, for example, become a I in later releases). @@ -1338,8 +1344,8 @@ =item ora_auto_lob -If true (the default), fetching retreives the contents of the CLOB or -BLOB column in most circumstances. If false, fetching retreives the +If true (the default), fetching retrieves the contents of the CLOB or +BLOB column in most circumstances. If false, fetching retrieves the Oracle "LOB Locator" of the CLOB or BLOB value. See L for more details. @@ -1562,10 +1568,10 @@ =head2 Perl and Unicode -Perl began implementing Unicode with version 5.6, but the implementaion +Perl began implementing Unicode with version 5.6, but the implementation did not mature until version 5.8 and later. If you plan to use Unicode you are I urged to use perl 5.8.2 or later and to I read -the perl documention on Unicode: +the perl documentation on Unicode: perldoc perluniintro # in perl 5.8 or later perldoc perlunicode @@ -1704,7 +1710,7 @@ the NLS_LANG and NLS_NCHAR settings. If the placeholder is for inserting an NCLOB then the client NLS_NCHAR -character set is used. (That's useful but inconsistent with the other behaviour +character set is used. (That's useful but inconsistent with the other behavior so may change. Best to be explicit by using the C attribute.) @@ -1742,7 +1748,7 @@ such as DATE, when used. Some of these automatic conversions to and from strings use NLS -setings to control the formating for output and the parsing for +settings to control the formatting for output and the parsing for input. The most common example is the DATE type. The default NLS format for DATE might be DD-MON-YYYY and so when a DATE type is fetched that's how Oracle will format the date. NLS settings also @@ -2167,7 +2173,7 @@ use of $sth->{NAME} or a similar attribute and the describe fails then I even if C is false! -Set L to 0 in prepare() to enable this behaviour. +Set L to 0 in prepare() to enable this behavior. =head1 Handling LOBs @@ -2272,7 +2278,7 @@ attribute is false, or returned via PL/SQL procedure calls. (If using a DBI version earlier than 1.36 they must be called via the -func() method. Note that methods called via func() don't honour +func() method. Note that methods called via func() don't honor RaiseError etc, and so it's important to check $dbh->err after each call. It's recommended that you upgrade to DBI 1.38 or later.) @@ -2283,7 +2289,7 @@ B Currently multi-byte character set issues have not been fully worked out. So these methods may not do what you expect if either the perl data is utf8 or the CLOB is a multi-byte character set -(including uft8). The current behaviour in these situations may not be +(including uft8). The current behavior in these situations may not be correct and is B. I =over 4 @@ -2653,7 +2659,7 @@ In Oracle, server side open cursors are a controlled resource, limited in number, on a per session basis, to the value of the initialization -parameter C. Nested cursors count towards ths limit. +parameter C. Nested cursors count towards this limit. Each nested cursor in the current row counts 1, as does each nested cursor in a pre-fetched row. Defunct nested cursors do not count. Index: t/26exe_array.t =================================================================== --- t/26exe_array.t (revision 6867) +++ t/26exe_array.t (working copy) @@ -70,7 +70,7 @@ cmp_ok(scalar @{$tuple_status}, '==', 10, '... we should have 10 tuple_status'); -# simple check to ensurte the error is returned in the status tuple +# simple check to ensure the error is returned in the status tuple @var2 = (2,2,2,2,'s',2,2,2,2,2); @@ -79,7 +79,7 @@ \@var1, \@var2, \@var2, - ), '... execute_array should return flase'); + ), '... execute_array should return false'); cmp_ok(scalar @{$tuple_status}, '==', 10, '... we should have 10 tuple_status');