On Wed, May 11, 2005 at 10:51:54AM -0500, Daniel S. Lewart wrote:
> Tim,
> 
> >> The patch below adds a bind_columns example to
> >> bind columns to array elements.
> 
> >Thanks, but why would you want to?
> >Why not just use the array ref returned by fetch() or fetchrow_arrayref()?
> >Saving a few microseconds by avoiding the assignment doesn't seem worth
> >an example.
> 
> Two reasons:
> 
> 1) http://search.cpan.org/~timb/DBI/DBI.pm#fetchrow_arrayref says:
>       This is the fastest way to fetch data,
>       particularly if used with $sth->bind_columns.
> 
> 2) http://search.cpan.org/src/TIMB/DBI_AdvancedTalk_2004/sld018.htm says:
>       Bind those columns!

It also says "No column access code!" because it's binding the columns to
scalar variables. That's where the the major win is.

I didn't expect anyone to bind columns into array elements
as I figured there wasn't much point.

> Please don't apply my patch then, but perhaps the fetchrow_arrayref
> documentation could be adjusted to avoid such misinterpretation.

Okay. Thanks.

Tim.

Reply via email to