in reply to PERL DBI Oracle
or if you later realise you need to store the pairs anyway... ;)# ... $sth->bind_columns( undef,\$alias); my $key = 0; while($sth->fetchrow_array()) { if ( $key ) { print "$key, $alias\n"; $key = 0; } else{ $key = $alias; } }
(updated to get rid of an unnecessary step)$sth->bind_columns( undef,\$alias); my %hash; my $key = 0; while($sth->fetchrow_array()) { if ( $key ) { $hash{ $key } = $alias; # print "$key, $alias\n"; $key = 0; } else{ $key = $alias; } }
^M Free your mind!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: PERL DBI Oracle
by farhan (Novice) on May 16, 2007 at 01:04 UTC | |
|
Re^2: PERL DBI Oracle
by farhan (Novice) on May 16, 2007 at 02:44 UTC | |
by Moron (Curate) on May 16, 2007 at 12:36 UTC |