in reply to DBI select ids to @ids
I think this will do the trick:
use DBI; my $dbh = DBI->connect(...); my $stmt = 'select id from items where foo > 42'; my @ids = map { $_->[0] } @{ $dbh->selectall_arrayref($stmt) };
map is used to convert an array of rows of fields into an array of (what's in the first field of each row).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBI select ids to @list
by tomazos (Deacon) on Aug 10, 2005 at 05:43 UTC | |
by ikegami (Patriarch) on Aug 10, 2005 at 05:52 UTC |