Index: trunk/ippToPsps/jython/detectionbatch.py
===================================================================
--- trunk/ippToPsps/jython/detectionbatch.py	(revision 38397)
+++ trunk/ippToPsps/jython/detectionbatch.py	(revision 38602)
@@ -413,5 +413,5 @@
         sqlLine.group("ippDetectID",     "IPP_IDET")                                                
 #        sqlLine.group("randomDetID",     "FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)")                       
-        sqlLine.group("randomDetID",     "(RAND("+str(self.batchID)+")")                       
+        sqlLine.group("randomDetID",     "RAND("+str(self.batchID)+")")                       
         sqlLine.group("filterID",        str(self.filterID))                                        
         sqlLine.group("surveyID",        str(self.surveyID))                                        
@@ -672,7 +672,7 @@
     '''
     def updateDvoIDs(self, table, externID):
-
+        self.logger.info("getting imge id")
         imageID = self.scratchDb.getImageIDFromExternID(externID)
-        self.logger.debug("Updating table '" + table + "' with DVO IDs using imageID = %d" % imageID)
+        self.logger.info("Updating table '" + table + "' with DVO IDs using imageID = %d" % imageID)
 
         sql = "UPDATE IGNORE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \
@@ -686,12 +686,13 @@
                a.telluricExt  = b.telluricExt, \
                a.airmass      = b.airmass, \
-               a.expTime      = b.expTime, \
-               a.infoFlag2    = (b.flags << 13) | a.infoFlag2 \
+               a.infoFlag3    = b.flags, \
+               a.expTime      = b.expTime \
                WHERE a.ippDetectID = b.ippDetectID \
                AND b.imageID = " + str(imageID)
 
-        try: self.scratchDb.execute(sql)
-        except:
-            self.logger.InfoPair("failed sql",sql)
+        print sql
+        try: self.scratchDb.execute(sql)
+        except:
+            self.logger.infoPair("failed sql",sql)
             raise
     '''
@@ -740,8 +741,9 @@
         #detection has a primary index, so don't add, use this one
         self.scratchDb.addRowCountColumnNoKey("Detection_"+chipname, "row")
+        self.logger.info("added row")
         self.updateDvoIDs("Detection_" + chipname, self.imageIDs[chipname])
-        #self.logger.info("updated dvoids")
+        self.logger.info("updated dvoids")
         results['NULLOBJID'] = self.scratchDb.reportAndDeleteRowsWithNULLS("Detection_" + chipname, "objID")
-        #self.logger.info("deleted nulls")
+        self.logger.info("deleted nulls")
 
         ota = x*10+y
