my $org_id; my $org_nm; my $dbh=DBI->connect('DBI:Oracle:xxx', 'yyy', 'zzz') or die "Cannot connect to DB: " . DBI->errstr; my $sql = "SELECT org_id,org_name FROM mv_org_structure_list WHERE 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]"); }