Index: trunk/ippTools/src/disttool.c
===================================================================
--- trunk/ippTools/src/disttool.c	(revision 26192)
+++ trunk/ippTools/src/disttool.c	(revision 26193)
@@ -52,5 +52,5 @@
 static bool definetargetMode(pxConfig *config);
 static bool updatetargetMode(pxConfig *config);
-static bool listtargetMode(pxConfig *config);
+static bool listtargetsMode(pxConfig *config);
 
 static bool definedestinationMode(pxConfig *config);
@@ -100,5 +100,5 @@
         MODECASE(DISTTOOL_MODE_DEFINETARGET, definetargetMode);
         MODECASE(DISTTOOL_MODE_UPDATETARGET, updatetargetMode);
-        MODECASE(DISTTOOL_MODE_LISTTARGET, listtargetMode);
+        MODECASE(DISTTOOL_MODE_LISTTARGETS, listtargetsMode);
         MODECASE(DISTTOOL_MODE_DEFINEDESTINATION, definedestinationMode);
         MODECASE(DISTTOOL_MODE_UPDATEDESTINATION, updatedestinationMode);
@@ -1311,5 +1311,5 @@
 }
 
-static bool listtargetMode(pxConfig *config)
+static bool listtargetsMode(pxConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(config, false);
@@ -1611,4 +1611,5 @@
     PXOPT_COPY_S64(config->args, where, "-dest_id",   "dest_id", "==");
     PXOPT_COPY_S64(config->args, where, "-target_id", "target_id", "==");
+    PXOPT_COPY_STR(config->args, where, "-dest_name", "rcDestination.name", "LIKE");
     PXOPT_COPY_STR(config->args, where, "-filter", "filter", "LIKE");
 
@@ -1619,6 +1620,5 @@
         return false;
     }
-    psString query = NULL;
-    psStringAppend(&query, "UPDATE rcInterest join distTarget using(target_id) SET rcInterest.state = '%s'", state);
+    psString query = pxDataGet("disttool_updateinterest.sql");
 
     if (psListLength(where->list)) {
@@ -1634,5 +1634,5 @@
     psFree(where);
 
-    if (!p_psDBRunQuery(config->dbh, query)) {
+    if (!p_psDBRunQueryF(config->dbh, query, state)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         psFree(query);
