3 # [-varcol => varname,]
6 # tablename => indexname,
9 package NetSNMP::manager::getValues;
12 @EXPORT_OK=(getValues);
14 my $varcol = "varcol";
15 my $valcol = "valcol";
20 my (@vars2, $tmp, $cursor, $row, %results, $i, $cursor);
21 my ($varcol, $valcol, $key) = ($varcol, $valcol, $key);
27 $varcol = $tmp if ($i =~ /-varcol/);
28 $valcol = $tmp if ($i =~ /-valcol/);
29 $key = $tmp if ($i =~ /-key/);
37 # print "select $varcol,$valcol from $i where $key = '$tmp'\n";
39 $dbh->prepare("select $varcol,$valcol from $i where $key = '$tmp'"))
40 or die "\nnot ok: $DBI::errstr\n";
42 or die "\nnot ok: $DBI::errstr\n";
43 while ( $row = $cursor->fetchrow_hashref ) {
44 $results{$row->{$varcol}} = $row->{$valcol};