Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^6: Perl DBI

by Tux (Monsignor)
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

Comment on Re^6: Perl DBI
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041812]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2016-02-10 02:59 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (331 votes), past polls