Index: trunk/ippTools/src/disttool.c
===================================================================
--- trunk/ippTools/src/disttool.c	(revision 23339)
+++ trunk/ippTools/src/disttool.c	(revision 23365)
@@ -98,12 +98,7 @@
     PXOPT_LOOKUP_STR(set_label, config->args, "-set_label", false, false);
 
-    bool require_chip_id = false;
-    if (!strcmp(stage, "raw")) {
-        // need to know the chip id for raw stage so that we can find the masks
-        require_chip_id = true;
-    }
-    PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id",  require_chip_id, false);
-
     // TODO: check that stage has an expected value
+    // XXX: all of the following concerns will be managed properly by definebyquery
+
     // TODO: check that stage_id actually exists for stage
     // in magicdstool we queue off of a magic_id so the stage_id, exp_id, and cam_id get looked up 
@@ -113,5 +108,5 @@
     // change between the time that it is queued.
 
-    if (!distRunInsert(config->dbh, 0, stage, stage_id, chip_id, set_label, outroot, clean, "new", 0)) {
+    if (!distRunInsert(config->dbh, 0, stage, stage_id, set_label, outroot, clean, "new", NULL, 0)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         return false;
@@ -151,16 +146,16 @@
     }
 
-    psString query = psStringCopy("UPDATE distRun");
+    psString query = psStringCopy("UPDATE distRun SET time_stamp = UTC_TIMESTAMP()");
 
     if (state) {
-        psStringAppend(&query, " SET state = '%s'", state);
+        psStringAppend(&query, " , state = '%s'", state);
     }
 
     if (label) {
-        psStringAppend(&query, " SET label = '%s'", label);
+        psStringAppend(&query, " , label = '%s'", label);
     }
 
     if (code) {
-        psStringAppend(&query, " SET fault = %d", code);
+        psStringAppend(&query, " , fault = %d", code);
     }
 
