Index: /trunk/ippTools/src/dettool.c
===================================================================
--- /trunk/ippTools/src/dettool.c	(revision 9493)
+++ /trunk/ippTools/src/dettool.c	(revision 9494)
@@ -1020,5 +1020,5 @@
 {
     PS_ASSERT_PTR_NON_NULL(config, false);
-  
+
     // select detProcessedImfile.det_id
     // select detRun.iteration
@@ -1725,5 +1725,5 @@
 
     psString query = psStringCopy(
-        "SELECT" 
+        "SELECT"
         "   det_id,"
         "   det_type,"
@@ -2248,5 +2248,5 @@
 {
     PS_ASSERT_PTR_NON_NULL(config, false);
-  
+
     psString query = psStringCopy(
         " SELECT DISTINCT"
@@ -2338,5 +2338,5 @@
 {
     PS_ASSERT_PTR_NON_NULL(config, false);
- 
+
     // det_id, recip, -bg, -bg_stdev, & -bg_mean_stdev
     // are required
@@ -2724,10 +2724,10 @@
 
     if (config->where) {
-	bool status;
-	int iteration = psMetadataLookupS32 (&status, config->where, "iteration");
-	if (status) {
-	    psMetadataRemoveKey (config->where, "iteration");
-	    psMetadataAddS32 (config->where, PS_LIST_TAIL, "iteration", 0, "==", iteration);
-	}
+        bool status;
+        int iteration = psMetadataLookupS32 (&status, config->where, "iteration");
+        if (status) {
+            psMetadataRemoveKey (config->where, "iteration");
+            psMetadataAddS32 (config->where, PS_LIST_TAIL, "iteration", 0, "==", iteration);
+        }
         psString whereClause = psDBGenerateWhereConditionSQL(config->where, "detNormalizedImfile");
         psStringAppend(&query, " AND %s", whereClause);
@@ -3126,5 +3126,6 @@
         "   det_type,"
         "   exp_tag,"
-        "   include"
+        "   include,"
+        "   camera"
         " FROM"
         "   (SELECT DISTINCT"
@@ -3134,5 +3135,6 @@
         "       detInputExp.exp_tag,"
         "       detInputExp.include,"
-        "       rawDetrendExp.imfiles"
+        "       rawDetrendExp.imfiles,"
+        "       rawDetrendExp.camera"
         "   FROM detRun"
         "       LEFT JOIN detInputExp"
@@ -4118,15 +4120,15 @@
         " WHERE"
         "   detRun.state = 'run'");
-    
-    // XXX this query was not restricted by det_id, resulting 
+
+    // XXX this query was not restricted by det_id, resulting
     // in an inconsistent UPDATE below.  I added this AND clause
     // though there may be a cleaner method (EAM 2006.10.08)
     psStringAppend (
-	&query,
-	"  AND detRun.det_id = '%s'", det_id);
+        &query,
+        "  AND detRun.det_id = '%s'", det_id);
 
     psStringAppend (
-	&query, 
-	" GROUP BY"
+        &query,
+        " GROUP BY"
         "   detRun.det_id,"
         "   detRun.iteration,"
@@ -4154,5 +4156,5 @@
         return true;
     }
-    
+
     // start a transaction so we don't end up with an incremented iteration
     // count but no detInputExps
