*** BeanCounter.pm 2006/03/09 02:09:21 1.100 --- BeanCounter.pm 2006/03/17 02:10:38 *************** *** 1030,1037 **** if (ExistsDailyData($dbh, %{$hash{$key}})) { my @vals = (); foreach my $col (@cols) { ! $hash{$key}{$col} =~ s/^\s*N\/A\s*$//; ! push(@vals, $hash{$key}{$col}); } if ($Config{commit}) { if (!defined($updSth)) { --- 1030,1040 ---- if (ExistsDailyData($dbh, %{$hash{$key}})) { my @vals = (); foreach my $col (@cols) { ! if ($hash{$key}{$col} =~ m/^\s*N\/A\s*$/) { ! push(@vals, undef); ! } else { ! push(@vals, $hash{$key}{$col}); ! } } if ($Config{commit}) { if (!defined($updSth)) { *************** *** 1039,1052 **** } $updSth->execute(@vals) and $updSth->finish() ! or warn $dbh->errstr . "Update failed for $hash{$key}{symbol} with [$updStmt]\n"; } } else { my @vals = (); foreach my $col (@cols) { ! $hash{$key}{$col} =~ s/^\s*N\/A\s*$//; ! push(@vals, $hash{$key}{$col}); } if ($Config{commit}) { if (!defined($insSth)) { --- 1042,1059 ---- } $updSth->execute(@vals) and $updSth->finish() ! or warn $dbh->errstr . "Update failed for " . ! "$hash{$key}{symbol} with [$updStmt]\n"; } } else { my @vals = (); foreach my $col (@cols) { ! if ($hash{$key}{$col} =~ m/^\s*N\/A\s*$/) { ! push(@vals, undef); ! } else { ! push(@vals, $hash{$key}{$col}); ! } } if ($Config{commit}) { if (!defined($insSth)) { *************** *** 1054,1060 **** } $insSth->execute(@vals) and $insSth->finish() ! or warn $dbh->errstr . "Insert failed for $hash{$key}{symbol} with [$insStmt]\n"; } } } --- 1061,1068 ---- } $insSth->execute(@vals) and $insSth->finish() ! or warn $dbh->errstr . "Insert failed for " . ! "$hash{$key}{symbol} with [$insStmt]\n"; } } }