Changeset 10227 for trunk/ippTools/src/dettool.c
- Timestamp:
- Nov 28, 2006, 11:30:28 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r10223 r10227 4749 4749 PS_ASSERT_PTR_NON_NULL(config, false); 4750 4750 4751 psString query = psStringCopy( 4752 "SELECT DISTINCT\n" 4753 " detRunSummary.*,\n" 4754 " detRun.det_type,\n" 4755 " detRun.mode\n" 4756 " FROM detRun\n" 4757 " JOIN detRunSummary\n" 4758 " USING(det_id, iteration)\n" 4759 " WHERE\n" 4760 " detRun.state = 'run'\n" 4761 ); 4762 4763 if (config->where) { 4764 psString whereClause = psDBGenerateWhereConditionSQL(config->where, NULL); 4765 psStringAppend(&query, " AND %s", whereClause); 4766 psFree(whereClause); 4767 } 4768 4769 if (!p_psDBRunQuery(config->dbh, query)) { 4770 psError(PS_ERR_UNKNOWN, false, "database error"); 4771 psFree(query); 4772 return false; 4773 } 4774 psFree(query); 4775 4776 psArray *output = p_psDBFetchResult(config->dbh); 4777 if (!output) { 4778 psError(PS_ERR_UNKNOWN, false, "database error"); 4779 return false; 4780 } 4781 if (!psArrayLength(output)) { 4782 psError(PS_ERR_UNKNOWN, false, "no detRunSummary rows found"); 4783 psFree(output); 4784 return true; 4785 } 4786 4787 bool simple = false; 4788 { 4789 bool status = false; 4790 simple = psMetadataLookupBool(&status, config->args, "-simple"); 4791 if (!status) { 4792 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 4793 return false; 4794 } 4795 } 4796 4797 // negative simple so the default is true 4798 if (!ippdbPrintMetadatas(stdout, output, "rawDetrendImfile", !simple)) { 4799 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 4800 psFree(output); 4801 return false; 4802 } 4803 4804 psFree(output); 4805 4751 4806 return true; 4752 4807 }
Note:
See TracChangeset
for help on using the changeset viewer.
