Changeset 9273
- Timestamp:
- Oct 4, 2006, 4:11:17 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/camtool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/camtool.c
r9272 r9273 51 51 { 52 52 PS_ASSERT_PTR_NON_NULL(config, false); 53 54 // return only exps that:55 // are not in rawScienceExp56 // are not in rawDetrendExp57 // have ALL of their imfiles in rawImfile (by count)58 // and have no associated imfiles left in newImfile59 53 60 54 psString query = psStringCopy("SELECT * FROM p3PendingExp"); … … 111 105 PS_ASSERT_PTR_NON_NULL(config, false); 112 106 113 // select newImfiles that: 114 // exp_tag is in newExp 115 // don't have their exp_tag in rawScienceExp 116 // don't have their exp_tag in rawDetrendExp 117 // XXX having the same exp_tag in newExp and raw*Exp is probably an error 118 // that should be checked for 119 char *query = 120 "SELECT newImfile.* FROM newImfile" 121 " LEFT JOIN newExp USING(exp_tag)" 122 " LEFT JOIN rawScienceExp USING(exp_tag)" 123 " LEFT JOIN rawDetrendExp USING (exp_tag)" 124 " WHERE newExp.exp_tag is NOT NULL" 125 " AND rawScienceExp.exp_tag IS NULL" 126 " AND rawDetrendExp.exp_tag IS NULL"; 107 psString query = psStringCopy( 108 "SELECT p2ProcessedImfile.*" 109 " FROM p3PendingExp" 110 " JOIN p2ProcessedImfile" 111 " USING(exp_tag, p2_version)" 112 ); 113 114 if (config->where) { 115 psString whereClause = psDBGenerateWhereSQL(config->where, "p2ProcessedImfile"); 116 psStringAppend(&query, " %s", whereClause); 117 psFree(whereClause); 118 } 127 119 128 120 if (!p_psDBRunQuery(config->dbh, query)) { 129 121 psError(PS_ERR_UNKNOWN, false, "database error"); 122 psFree(query) 130 123 return false; 131 124 } 125 psFree(query) 132 126 133 127 psArray *output = p_psDBFetchResult(config->dbh); … … 138 132 if (!psArrayLength(output)) { 139 133 // XXX check psError here 140 psError(PS_ERR_UNKNOWN, false, "no pending newImfile rows found");134 psError(PS_ERR_UNKNOWN, false, "no pending p2ProcessedImfile rows found"); 141 135 psFree(output); 142 136 return true; … … 154 148 155 149 // negate simple so the default is true 156 if (!ippdbPrintMetadatas(stdout, output, " newImfile", !simple)) {150 if (!ippdbPrintMetadatas(stdout, output, "p2ProcessedImfile", !simple)) { 157 151 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 158 152 psFree(output);
Note:
See TracChangeset
for help on using the changeset viewer.
