jblapham has asked for the wisdom of the Perl Monks concerning the following question:
The data is extracted from the database fine. I have printed the $dummyrows and see the data. I just can't get the hash to print values. Thanks, Jimundef %db_processes; $dbh = DBI->connect("dbi:ODBC:$dsn_name", "$dsn_user", "$dsn_pwd") or quittext_opc ("Failed to connect to database $dsn_name\n", +$app, $SEV1, $GRP3, "5051", $STAT1); $qry = "select sid,'|',serial#,'|',status,'|',process,'|',username,'|' + from v\$session;"; $sth = $dbh->prepare($qry); $sth->execute(); while ( @dummyrow = $sth->fetchrow_array ) { ($pp0,$pp1) = split /:/,$dummyrow[6]; $db_processes{$pp1} = {SID => $dummyrow[0], SERIAL => $dummyrow[2], STATUS => $dummyrow[4], PROCESS => $dummyrow[6], USERNAME => $dummyrow[8], }; } foreach $hashy (@db_processes) { print "in if\n"; print "$hashy->[0]\n"; } $dbh->disconnect();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash usage
by blokhead (Monsignor) on Feb 06, 2003 at 16:46 UTC | |
by jblapham (Novice) on Feb 06, 2003 at 19:03 UTC | |
by blokhead (Monsignor) on Feb 06, 2003 at 21:23 UTC | |
|
Re: Hash usage
by davorg (Chancellor) on Feb 06, 2003 at 16:50 UTC |