Author: hmbrand
Date: Wed Feb 3 11:54:32 2010
New Revision: 13806
Modified:
dbi/trunk/Changes
dbi/trunk/DBI.pm
Log:
Fix typos. Some rewording (mje)
Note to self: use the spellchecker more often. It's not a bad thing
others make mistakes too.
Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes (original)
+++ dbi/trunk/Changes Wed Feb 3 11:54:32 2010
@@ -8,8 +8,8 @@
=head2 Changes in DBI 1.611 (svn rXXX)
- Document fetchrow_hashref() behaviour for aggregate functions,
- aliasses and duplicate names (H.Merijn Brand)
+ Document fetchrow_hashref() behaviour for functions,
+ aliases and duplicate names (H.Merijn Brand)
Fixed DBI->trace(0, *STDERR); (H.Merijn Brand)
which tried to open a file named "*main::STDERR" in perl-5.10.x
Corrected typos in Gopher documentation. Tipped by Jan Krynicky.
Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm (original)
+++ dbi/trunk/DBI.pm Wed Feb 3 11:54:32 2010
@@ -6033,20 +6033,21 @@
error.
The optional C<$name> parameter specifies the name of the statement handle
-attribute. For historical reasons it defaults to "C<NAME>", however using
either
-"C<NAME_lc>" or "C<NAME_uc>" is recomended for portability.
+attribute. For historical reasons it defaults to "C<NAME>", however using
+either "C<NAME_lc>" or "C<NAME_uc>" is recommended for portability.
The keys of the hash are the same names returned by C<$sth-E<gt>{$name}>. If
-more than one field has the same name, there will only be one entry in
-the returned hash for those fields, so statements like
-"C<select foo, foo from bar>" are returning only one single entry for
-C<fetchrow_hashref>. In these cases use column aliasses or
C<fetchrow_arrayref>.
-Note that is the database server (and thus not of the DBD implementation) that
-returns the I<name> of aggregate fields like "C<count(*)>" or "C<max(c_foo)>",
-which may clash with existing column names. If you want these to return as
-unique names that are the same accross databases, use I<aliasses>, like in
-"C<select count(*) as cnt>" or "C<select max(c_foo) mx_foo, ...>" depending on
-what syntax you DBD supports.
+more than one field has the same name, there will only be one entry in the
+returned hash for those fields, so statements like "C<select foo, foo from
bar>"
+will return only a single key from C<fetchrow_hashref>. In these cases use
+column aliases or C<fetchrow_arrayref>. Note that it is the database server
+(and not the DBD implementation) which provides the I<name> for fields
+containing functions like "C<count(*)>" or "C<max(c_foo)>" and they may clash
+with existing column names (most databases don't care about duplicate column
+names in a result-set). If you want these to return as unique names that are
+the same across databases, use I<aliases>, as in "C<select count(*) as cnt>"
+or "C<select max(c_foo) mx_foo, ...>" depending on the syntax your database
+supports.
Because of the extra work C<fetchrow_hashref> and Perl have to perform, it
is not as efficient as C<fetchrow_arrayref> or C<fetchrow_array>.
@@ -6462,7 +6463,7 @@
print "First column name: $sth->{NAME}->[0]\n";
-Also note that the name returned for aggregate functions like C<count(*)>
+Also note that the name returned for (aggregate) functions like C<count(*)>
or C<max(c_foo)> is determined by the database server and not by C<DBI> or
the C<DBD> backend.