Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^6: Perl DBI

by Tux (Abbot)
on Jul 01, 2013 at 10:51 UTC ( #1041812=note: print w/replies, xml ) Need Help??

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041812]
marioroy just logged in to say that MCE::Hobo has passed testing and therefore will continue to run like threads but have managed capabilities similar to Parallel:: ForkManager. It allows multiple managed instances to run simultaneously. Zero limitations.
marioroy it's taken a long time to make this possible.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2017-07-28 19:42 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (433 votes). Check out past polls.