Changeset 26915 for trunk/ippTools/src/addtool.c
- Timestamp:
- Feb 11, 2010, 3:01:34 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/addtool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/addtool.c
r26911 r26915 99 99 PXOPT_COPY_S64(config->args, where, "-cam_id", "camRun.cam_id", "=="); 100 100 pxAddLabelSearchArgs (config, where, "-label", "camRun.label", "=="); // define using camRun label 101 pxAddLabelSearchArgs (config, where, "-data_group","camRun.data_group", "=="); // define using camRun label 101 102 PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "=="); 102 103 … … 119 120 120 121 // find the cam_id of all the exposures that we want to queue up. 121 psString query = pxDataGet("addtool_find_cam_id.sql");122 if (! query) {122 psString bare_query = pxDataGet("addtool_find_cam_id.sql"); 123 if (!bare_query) { 123 124 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 124 125 psFree(where); 125 126 return false; 126 127 } 128 129 // prevent queueing an addRun if a given exposure has already been added to 130 // the given dvo database 131 psString dvodb_string = NULL; 132 if (dvodb) { 133 // user supplied dvodb 134 psStringAppend(&dvodb_string, "(previous_dvodb = '%s')", dvodb); 135 } else { 136 // inherit dvodb from camRun, avoid matching NULL 137 psStringAppend(&dvodb_string, "(camRun.dvodb IS NOT NULL AND previous_dvodb = camRun.dvodb)"); 138 } 139 // Take the bare query and add the dvodb selector 140 psString query = NULL; 141 psStringAppend(&query, bare_query, dvodb_string); 142 psFree(dvodb_string); 143 psFree(bare_query); 127 144 128 145 // use psDBGenerateWhereConditionSQL because the SQL ends in a WHERE … … 131 148 psStringAppend(&query, " AND %s", whereClause); 132 149 psFree(whereClause); 150 } else { 151 psError(PS_ERR_UNKNOWN, true, "search parameters are required"); 152 return false; 133 153 } 134 154 psFree(where);
Note:
See TracChangeset
for help on using the changeset viewer.
