[freeside-commits] freeside/FS/bin freeside-torrus-srvderive, 1.51, 1.52
Ivan,,,
ivan at wavetail.420.am
Thu May 19 10:39:09 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv20615
Modified Files:
freeside-torrus-srvderive
Log Message:
calculate sum separately?
Index: freeside-torrus-srvderive
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-torrus-srvderive,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -w -d -r1.51 -r1.52
--- freeside-torrus-srvderive 19 May 2011 17:34:55 -0000 1.51
+++ freeside-torrus-srvderive 19 May 2011 17:39:06 -0000 1.52
@@ -203,14 +203,18 @@
AND other.srv_date = '$srv_date'
AND ABS( $cur - $other_date ) <= 60
";
+ my $ssth = dbh->prepare($sum) or die $DBI::errstr;
+ $ssth->execute or die $ssth->errstr; #better recovery?
+ my $value = $ssth->fetchrow_arrayref->[0];
my $isql = "
INSERT INTO srvexport ( srv_date, srv_time, serviceid, value, intvl )
- VALUES ( ?, ?, ?, ($sum), ? )
+ VALUES ( ?, ?, ?, ?, ? )
";
my @param = ( $srv_date,
time2str('%X', $cur), #srv_time
"$serviceid$dir", #serviceid
+ $value,
300, #intvl ...
);
warn $isql. ' with param '. join(',', at param). "\n"
More information about the freeside-commits
mailing list