IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 4, 2006, 4:03:21 PM (20 years ago)
Author:
jhoblitt
Message:

implement -pendingexp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/camtool.c

    r9271 r9272  
    5858    // and have no associated imfiles left in newImfile
    5959
    60     char *query =
    61         "SELECT newExp.*"
    62         " FROM newExp"
    63         " LEFT JOIN newImfile USING(exp_tag)"
    64         " LEFT JOIN rawScienceExp USING(exp_tag)"
    65         " LEFT JOIN rawDetrendExp USING(exp_tag)"
    66         " WHERE"
    67         "   newExp.exp_tag IS NOT NULL"
    68         "   AND newImfile.exp_tag IS NULL"
    69         "   AND rawScienceExp.exp_tag IS NULL"
    70         "   AND newExp.imfiles ="
    71         "   (SELECT COUNT(exp_tag) FROM rawImfile"
    72         "       WHERE rawImfile.exp_tag = newExp.exp_tag)"
    73         ;
     60    psString query = psStringCopy("SELECT * FROM p3PendingExp");
     61
     62    if (config->where) {
     63        psString whereClause = psDBGenerateWhereSQL(config->where, NULL);
     64        psStringAppend(&query, " %s", whereClause);
     65        psFree(whereClause);
     66    }
    7467
    7568    if (!p_psDBRunQuery(config->dbh, query)) {
    7669        psError(PS_ERR_UNKNOWN, false, "database error");
     70        psFree(query);
    7771        return false;
    7872    }
     73    psFree(query);
    7974
    8075    psArray *output = p_psDBFetchResult(config->dbh);
     
    8580    if (!psArrayLength(output)) {
    8681        // XXX check psError here
    87         psError(PS_ERR_UNKNOWN, false, "no pending newExp rows found");
     82        psError(PS_ERR_UNKNOWN, false, "no p3PendingExp rows found");
    8883        psFree(output);
    8984        return true;
     
    10196
    10297    // negate simple so the default is true
    103     if (!ippdbPrintMetadatas(stdout, output, "newImfile", !simple)) {
     98    if (!ippdbPrintMetadatas(stdout, output, "p3PendingExp", !simple)) {
    10499        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    105100        psFree(output);
Note: See TracChangeset for help on using the changeset viewer.