Changeset 9117 for trunk/ippTools/src/dettool.c
- Timestamp:
- Oct 2, 2006, 2:45:50 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r9115 r9117 798 798 PS_ASSERT_PTR_NON_NULL(config, false); 799 799 800 psString query = psStringCopy( 801 "SELECT detInputExp.det_id, detRun.det_type, rawImfile.*" 802 " FROM rawImfile" 803 " JOIN detInputExp USING(exp_tag) " 804 " JOIN detRun ON detInputExp.det_id = detRun.position" 805 ); 806 807 if (config->where) { 808 psString whereClause = psDBGenerateWhereSQL(config->where, "rawImfile"); 809 psStringAppend(&query, " %s", whereClause); 810 psFree(whereClause); 811 } 812 813 if (!p_psDBRunQuery(config->dbh, query)) { 814 psError(PS_ERR_UNKNOWN, false, "database error"); 815 psFree(query); 816 return false; 817 } 818 psFree(query); 819 820 psArray *output = p_psDBFetchResult(config->dbh); 821 if (!output) { 822 psError(PS_ERR_UNKNOWN, false, "database error"); 823 psFree(query); 824 } 825 if (!psArrayLength(output)) { 826 // XXX check psError here 827 psError(PS_ERR_UNKNOWN, false, "no rawImfile rows found"); 828 psFree(output); 829 return true; 830 } 831 832 bool simple = false; 833 { 834 bool status = false; 835 simple = psMetadataLookupBool(&status, config->args, "-simple"); 836 if (!status) { 837 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 838 return false; 839 } 840 } 841 842 // negative simple so the default is true 843 if (!ippdbPrintMetadatas(stdout, output, "rawImfile", !simple)) { 844 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 845 psFree(output); 846 return false; 847 } 848 849 psFree(output); 850 800 851 return true; 801 852 } … … 846 897 psArray *output = p_psDBFetchResult(config->dbh); 847 898 if (!output) { 899 psError(PS_ERR_UNKNOWN, false, "database error"); 900 psFree(query); 901 } 902 if (!psArrayLength(output)) { 848 903 // XXX check psError here 849 psError(PS_ERR_UNKNOWN, false, "no pending rawDetrendExp rows found"); 850 return false; 904 psError(PS_ERR_UNKNOWN, false, "no rawImfile rows found"); 905 psFree(output); 906 return true; 851 907 } 852 908 … … 862 918 863 919 // negative simple so the default is true 864 if (!ippdbPrintMetadatas(stdout, output, "raw DetrendImfile", !simple)) {920 if (!ippdbPrintMetadatas(stdout, output, "rawImfile", !simple)) { 865 921 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 866 922 psFree(output);
Note:
See TracChangeset
for help on using the changeset viewer.
