in reply to Re^5: Perl DBI
in thread Perl DBI
There are plenty ways to do it fast. The "best" way might be using a hash combined with bind_columns as described in the documentation:
my $dbh = DBI->connect ($dsn, $user, $pass, { FetchHashKeyName => "NAM +E_lc", … }); my ($sth, %rec) = $dbh->prepare ("select * from $tbl"); $sth->execute; $sth->bind_columns (\(@rec{@{$sth->{NAME_lc}}})); while ($sth->fetch) { $rec{"ne"} eq $bsc or next; # All fields accessible by their name (lc) }
Enjoy, Have FUN! H.Merijn
|
---|
In Section
Seekers of Perl Wisdom