Index: trunk/ippTools/src/camtool.c
===================================================================
--- trunk/ippTools/src/camtool.c	(revision 28274)
+++ trunk/ippTools/src/camtool.c	(revision 28339)
@@ -292,5 +292,5 @@
     PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
 
-    psString query = pxDataGet("camtool_find_pendingexp.sql");
+    psString query = pxDataGet("camtool_pendingexp.sql");
     if (!query) {
         psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
@@ -305,4 +305,6 @@
     }
     psFree(where);
+
+    psStringAppend(&query, "\nORDER BY priority DESC, cam_id");
 
     // treat limit == 0 as "no limit"
@@ -531,5 +533,5 @@
     PXOPT_COPY_S64(config->args, where, "-cam_id",   "camRun.cam_id",   "==");
 
-    psString query = pxDataGet("camtool_find_pendingexp.sql");
+    psString query = pxDataGet("camtool_addprocessedexp.sql");
     if (!query) {
         psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
