in reply to Re^2: Having problems with DBI selectall_arrayref
in thread Having problems with DBI selectall_arrayref
Sorry, I posted my reply too hastily. The second parameter you pass to ->selectall_arrayref must be a hash with the key Slice, not Columns:
my $data_all = $connection->selectall_arrayref($query, { Slice => {} +} );
Then, each element of $data_all will be a hashref (not a hash as you assume):
my $currec = $row; foreach my $columns (keys %$currec){ say $columns; say $currec{$columns}; }
Whenever you're in doubt about a data structure, consider using Data::Dumper to print it:
use Data::Dumper; say Dumper $row;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Having problems with DBI selectall_arrayref
by SergioQ (Scribe) on Dec 26, 2020 at 20:33 UTC |