in reply to Re^4: Perl DBI
in thread Perl DBI

If the first field of your tables is not NE then $_->[0] eq $bsc will not work. Using * is not recommended, apart from the performance issue you are at risk of a table change breaking your script.

poj

Replies are listed 'Best First'.
Re^6: Perl DBI
by Tux (Canon) on Jul 01, 2013 at 10:51 UTC

    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