Index: trunk/ippTools/src/pzgetimfiles.c
===================================================================
--- trunk/ippTools/src/pzgetimfiles.c	(revision 14023)
+++ trunk/ippTools/src/pzgetimfiles.c	(revision 14600)
@@ -274,6 +274,5 @@
             "       incoming.telescope,"
             "       incoming.class,"
-            "       incoming.class_id,"
-            "       NULL" // exp_id, will be assigned later
+            "       incoming.class_id"
             "   FROM incoming"
             "   JOIN pzPendingExp"
@@ -367,79 +366,4 @@
     }
 
-    // copy the summitExp row into newExp in order to create a new exp_id
-    {
-        psString exp_id = pxGenExpTag(config, filesetid);
-        if (!exp_id) {
-            // rollback
-            if (!psDBRollback(config->dbh)) {
-                psError(PS_ERR_UNKNOWN, false, "database error");
-            }
-            psError(PS_ERR_UNKNOWN, false, "database error");
-            return false;
-        }
-
-        char *query = 
-            "INSERT INTO newExp" 
-            "   SElECT"
-            "       '%s'," // exp_id
-            "       summitExp.exp_name,"
-            "       summitExp.camera,"
-            "       summitExp.telescope,"
-            "       summitExp.dateobs,"
-            "       summitExp.exp_type,"
-            "       summitExp.imfiles,"
-            "       0"      // error flags 
-            "   FROM summitExp"
-            "   WHERE"
-            "       summitExp.exp_name = '%s'"
-            "       AND summitExp.camera = '%s'"
-            "       AND summitExp.telescope = '%s'";
-
-        if (!p_psDBRunQuery(config->dbh, query, exp_id, filesetid, camera, telescope)) {
-            // rollback
-            if (!psDBRollback(config->dbh)) {
-                psError(PS_ERR_UNKNOWN, false, "database error");
-            }
-            psError(PS_ERR_UNKNOWN, false, "database error");
-            psFree(exp_id);
-            return false;
-        }
-        psFree(exp_id);
-
-        // sanity check: we should have inserted only one row
-        psU64 affected = psDBAffectedRows(config->dbh);
-        if (psDBAffectedRows(config->dbh) != 1) {
-            // rollback
-            if (!psDBRollback(config->dbh)) {
-                psError(PS_ERR_UNKNOWN, false, "database error");
-            }
-            psError(PS_ERR_UNKNOWN, false, "should have affected 1 row but %" PRIu64 " rows were modified", affected);
-            return false;
-        }
-    }
- 
-    // set the exp_id for the imfiles (files) in the exposure (fileset) that
-    // we are investigating
-    {
-        char *query = 
-            "UPDATE pzPendingImfile"
-            " SET exp_id = (SELECT exp_id from newExp"
-            "                WHERE exp_name = '%s'"
-            "                AND camera = '%s'"
-            "                AND telescope = '%s')"
-            " WHERE"
-            "   exp_name = '%s'"
-            "   AND camera = '%s'"
-            "   AND telescope = '%s'";
-        if (!p_psDBRunQuery(config->dbh, query, filesetid, camera, telescope, filesetid, camera, telescope)) {
-            // rollback
-            if (!psDBRollback(config->dbh)) {
-                psError(PS_ERR_UNKNOWN, false, "database error");
-            }
-            psError(PS_ERR_UNKNOWN, false, "database error");
-            return false;
-        }
-    }
-
     // cp the pzPendingExp entry to pzDoneExp
     {
