Index: trunk/ippTools/src/stacktool.c
===================================================================
--- trunk/ippTools/src/stacktool.c	(revision 37104)
+++ trunk/ippTools/src/stacktool.c	(revision 37384)
@@ -41,4 +41,5 @@
 static bool sumskyfileMode(pxConfig *config);
 static bool sassskyfileMode(pxConfig *config);
+static bool updatesassMode(pxConfig *config);
 static bool revertsumskyfileMode(pxConfig *config);
 static bool tosummaryMode(pxConfig *config);
@@ -82,5 +83,6 @@
         MODECASE(STACKTOOL_MODE_ADDSUMSKYFILE,         addsumskyfileMode);
         MODECASE(STACKTOOL_MODE_SUMSKYFILE,            sumskyfileMode);
-        MODECASE(STACKTOOL_MODE_SASSSKYFILE,            sassskyfileMode);
+        MODECASE(STACKTOOL_MODE_SASSSKYFILE,           sassskyfileMode);
+	MODECASE(STACKTOOL_MODE_UPDATESASS,            updatesassMode);
         MODECASE(STACKTOOL_MODE_REVERTSUMSKYFILE,      revertsumskyfileMode);
         MODECASE(STACKTOOL_MODE_TOSUMMARY,             tosummaryMode);
@@ -1295,9 +1297,4 @@
     PXOPT_COPY_STR(config->args, where, "-data_group", "stackAssociation.data_group", "LIKE");
 
-//  The following three selectors are incompatible with the sql so omit them
-//    PXOPT_COPY_S64(config->args, where, "-warp_id", "warpRun.warp_id", "==");
-//     PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "==");
-//    PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_name", "==");
-
     PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
 
@@ -1369,4 +1366,49 @@
 }
 
+static bool updatesassMode(pxConfig *config)
+{
+  PS_ASSERT_PTR_NON_NULL(config, false);
+
+  psMetadata *where = psMetadataAlloc();
+  PXOPT_COPY_S64(config->args, where, "-sass_id", "sass_id", "==");
+  PXOPT_COPY_STR(config->args, where, "-data_group", "data_group", "==");
+  PXOPT_COPY_STR(config->args, where, "-projection_cell", "projection_cell", "==");
+  PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "==");
+  PXOPT_COPY_STR(config->args, where, "-filter", "filter", "==");
+  if (!psListLength(where->list)) {
+    psFree(where);
+    psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");
+    return false;
+  }
+
+  psMetadata *values = psMetadataAlloc();
+  PXOPT_COPY_STR(config->args, values, "-set_data_group", "data_group", "==");
+  if (!psListLength(values->list)) {
+    psFree(values);
+    psError(PXTOOLS_ERR_CONFIG, false, "data_group to assign not found");
+    return false;
+  }
+
+  if (!psDBTransaction(config->dbh)) {
+    psError(PS_ERR_UNKNOWN, false, "database error");
+    return false;
+  }
+  
+  long rows = psDBUpdateRows(config->dbh, "stackAssociation", where, values);
+  psFree(values);
+  psFree(where);
+
+  if (rows != 1) {
+    psError(PS_ERR_UNKNOWN, false, "should have updated only one row. updated %ld", rows);
+    return false;
+  }
+
+  if (!psDBCommit(config->dbh)) {
+    psError(PS_ERR_UNKNOWN, false, "database error");
+    return false;
+  }
+
+  return true;
+}
 
 static bool revertsumskyfileMode(pxConfig *config)
