Index: trunk/ippTools/src/pztool.c
===================================================================
--- trunk/ippTools/src/pztool.c	(revision 12093)
+++ trunk/ippTools/src/pztool.c	(revision 14023)
@@ -140,5 +140,5 @@
             " FROM pzPendingExp"
             " JOIN summitExp"
-            "   USING(exp_id, camera, telescope)"
+            "   USING(exp_name, camera, telescope)"
         );
 
@@ -197,8 +197,8 @@
             "SELECT"
             "   summitImfile.*,"
-            "   pzPendingImfile.exp_tag"
+            "   pzPendingImfile.exp_id"
             " FROM pzPendingImfile"
             " JOIN summitImfile"
-            "   USING(exp_id, camera, telescope, class, class_id)"
+            "   USING(exp_name, camera, telescope, class, class_id)"
         );
 
@@ -255,11 +255,11 @@
 
     bool status = false;
-    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
-        return false;
-    }
-    if (!exp_id) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
+    psString exp_name = psMetadataLookupStr(&status, config->args, "-exp_name");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_name");
+        return false;
+    }
+    if (!exp_name) {
+        psError(PS_ERR_UNKNOWN, true, "-exp_name is required");
         return false;
     }
@@ -315,5 +315,5 @@
     }
 
-    // need to know exp_id, camera, telescope, class, class_id (to find the
+    // need to know exp_name, camera, telescope, class, class_id (to find the
     // pzPendingImfile entry and the URI for the newImfile entry.
 
@@ -329,5 +329,5 @@
             "INSERT INTO newImfile"
             "   SElECT"
-            "       pzPendingImfile.exp_tag,"
+            "       pzPendingImfile.exp_id,"
             "       pzPendingImfile.class,"
             "       pzPendingImfile.class_id,"
@@ -336,5 +336,5 @@
             "   FROM pzPendingImfile"
             "   WHERE"
-            "       pzPendingImfile.exp_id = '%s'"
+            "       pzPendingImfile.exp_name = '%s'"
             "       AND pzPendingImfile.camera = '%s'"
             "       AND pzPendingImfile.telescope = '%s'"
@@ -342,5 +342,5 @@
             "       AND pzPendingImfile.class_id = '%s'";
 
-        if (!p_psDBRunQuery(config->dbh, query, uri, exp_id, camera, telescope, class, class_id)) {
+        if (!p_psDBRunQuery(config->dbh, query, uri, exp_name, camera, telescope, class, class_id)) {
             // rollback
             if (!psDBRollback(config->dbh)) {
@@ -372,5 +372,5 @@
             "   FROM pzPendingImfile"
             "   WHERE"
-            "       pzPendingImfile.exp_id = '%s'"
+            "       pzPendingImfile.exp_name = '%s'"
             "       AND pzPendingImfile.camera = '%s'"
             "       AND pzPendingImfile.telescope = '%s'"
@@ -378,5 +378,5 @@
             "       AND pzPendingImfile.class_id = '%s'";
 
-        if (!p_psDBRunQuery(config->dbh, query, uri, exp_id, camera, telescope, class, class_id)) {
+        if (!p_psDBRunQuery(config->dbh, query, uri, exp_name, camera, telescope, class, class_id)) {
             // rollback
             if (!psDBRollback(config->dbh)) {
@@ -404,5 +404,5 @@
             "DELETE FROM pzPendingImfile"
             "   WHERE"
-            "       pzPendingImfile.exp_id = '%s'"
+            "       pzPendingImfile.exp_name = '%s'"
             "       AND pzPendingImfile.camera = '%s'"
             "       AND pzPendingImfile.telescope = '%s'"
@@ -410,5 +410,5 @@
             "       AND pzPendingImfile.class_id = '%s'";
 
-        if (!p_psDBRunQuery(config->dbh, query, exp_id, camera, telescope, class, class_id)) {
+        if (!p_psDBRunQuery(config->dbh, query, exp_name, camera, telescope, class, class_id)) {
             // rollback
             if (!psDBRollback(config->dbh)) {
