Index: trunk/ippTools/src/receivetool.c
===================================================================
--- trunk/ippTools/src/receivetool.c	(revision 24109)
+++ trunk/ippTools/src/receivetool.c	(revision 24125)
@@ -238,5 +238,5 @@
         psFree(output);
 
-        if (!receiveFilesetInsert(config->dbh, 0, source_id, fileset, "reg", NULL, 0)) {
+        if (!receiveFilesetInsert(config->dbh, 0, source_id, fileset, "reg", NULL, NULL, 0)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to add fileset");
             psFree(source_id_str);
@@ -512,5 +512,5 @@
     if (psListLength(where->list)) {
         psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
-        psStringAppend(&query, " WHERE %s", whereClause);
+        psStringAppend(&query, " AND %s", whereClause);
         psFree(whereClause);
     }
@@ -592,9 +592,11 @@
     // to chanage
     PXOPT_LOOKUP_S32(fault, config->args, "-fault", false, false);
-    PXOPT_LOOKUP_STR(dbinfo_uri, config->args, "-dbinfo_uri", false, false);
+    PXOPT_LOOKUP_STR(destdir, config->args, "-destdir", false, false);
+    PXOPT_LOOKUP_STR(dirinfo, config->args, "-dirinfo", false, false);
+    PXOPT_LOOKUP_STR(dbinfo, config->args, "-dbinfo", false, false);
     PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
 
-    if (!fault && !dbinfo_uri && !state) {
-        psError(PS_ERR_UNKNOWN, true, "one of -fault, -dbinfo_uri, -set_state are required");
+    if (!fault && !dirinfo &&!dbinfo && !state) {
+        psError(PS_ERR_UNKNOWN, true, "at least one of -fault, -dirinfo, -dbinfo, -set_state are required");
         return false;
     }
@@ -608,6 +610,10 @@
         sep = ",";
     }
-    if (dbinfo_uri) {
-        psStringAppend(&query, "%s dbinfo_uri = '%s'", sep, dbinfo_uri);
+    if (dirinfo) {
+        psStringAppend(&query, "%s dirinfo = '%s'", sep, dirinfo);
+        sep = ",";
+    }
+    if (dbinfo) {
+        psStringAppend(&query, "%s dbinfo = '%s'", sep, dbinfo);
         sep = ",";
     }
