djbryson has asked for the wisdom of the Perl Monks concerning the following question:
my $org_id; my $org_nm; my $dbh=DBI->connect('DBI:Oracle:xxx', 'yyy', 'zzz') or die "Cannot co +nnect to DB: " . DBI->errstr; my $sql = "SELECT org_id,org_name FROM mv_org_structure_list WHER +E ORG_TYPE='D'"; my $sth = $dbh->prepare($sql) || print "Cannot prepare"; $sth->execute || print "Cannot execute"; my @result; my %hasho; while (@result = $sth->fetchrow_array()) { $org_id = $result[0]; $org_nm = $result[1]; %hasho = ("$result[0]", "$result[1]"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: push/append to hash in a loop
by kyle (Abbot) on Mar 20, 2007 at 20:51 UTC | |
by djbryson (Beadle) on Mar 20, 2007 at 21:09 UTC | |
|
Re: push/append to hash in a loop
by johngg (Canon) on Mar 20, 2007 at 23:29 UTC | |
|
Re: push/append to hash in a loop
by agianni (Hermit) on Mar 21, 2007 at 00:58 UTC | |
by grinder (Bishop) on Mar 21, 2007 at 07:56 UTC | |
|
Re: push/append to hash in a loop
by anirudh_sml (Novice) on Mar 21, 2007 at 07:04 UTC |