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]"); }
In reply to push/append to hash in a loop by djbryson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |