note
CountOrlok
Your post appears to be confusing the concept of rows and columns.
<p>
I would recommend adding an additional parameter to _all_data().
The third parameter could be an arrayref. So the function could look like this:
<code>
sub _all_data {
my $self = shift;
my $sql = shift;
my $columns = shift;
my %column_hash = map { $_, 1 } @$columns;
my $sth = $mssql_dbh->prepare($sql);
$sth->execute() || die $sth->errstr;
# array indices for each returned row
my $rs = $sth->fetchall_arrayref( \%column_hash );
return $rs;
}
</code>
Now you have to pass the function a list of columns you want it to return.
<p>
As hdb mentioned, passing {} to fetchall_arrayref will return all columns.
With this above version of _all_data, if you do not pass a third parameter,
you will essentially be passing {} to fetchall_arrayref and therefore get all columns.
1026680
1026680