On Tue, May 10, 2005 at 04:30:30PM -0500, Daniel S. Lewart wrote:
> DBI/DBD implementors,
>
> 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.
Tim.
> +Columns can be bound to the elements of an array:
> +
> + $sth->execute;
> + my @row = @{$sth->{NAME}}; # Or (undef) x $sth->{NUM_OF_FIELDS};
> + $sth->bind_columns( \(@row) );
> + while ($sth->fetch) {
> + print "$row[0]: $row[1]\n";
> + }