Ok. Good enough, and good explanation for why. That's exactly what I was
looking for. Guess I'll keep typing that extra line :-). Thanks much.
Steve H.
-----Original Message-----
From: Michael A. Chase [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 04, 2001 2:58 PM
To: Steve Howard; DBI USERS
Subject: Re: bind columns
Perl has to copy every column value returned by fetchrow() to the
corresponding element of @array. With bind_columns(), no copying is
required. That is a major performance improvement if you have more than a
few rows.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.
----- Original Message -----
From: "Steve Howard" <[EMAIL PROTECTED]>
To: "DBI USERS" <[EMAIL PROTECTED]>
Sent: Wednesday, July 04, 2001 11:22
Subject: bind columns
> Is there any performance advantage of using a:
>
> $sth->bind_columns(undef, \(@array[0..$#cols]));
> while ($row = sth->fetchrow_arrayref) {}
I normally use
while ( $sth -> fetch ) {}
with $dbh -> {RaiseError} = 1. Once you've bound the parameters, there's no
need to copy even the reference.
> instead of skipping the bind columns and just doing:
> while (@array = sth->fetchrow) {}
>
>
> I just wonder why I normally type an extra line (Looking for a reason
other
> than that's the way I first learned it).