IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 7, 2008, 4:38:13 PM (18 years ago)
Author:
jhoblitt
Message:

add pztool -revertcopied mode

File:
1 edited

Legend:

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

    r16363 r16364  
    737737{
    738738    PS_ASSERT_PTR_NON_NULL(config, false);
     739
     740    psString query = pxDataGet("pztool_revertcopied.sql");
     741    if (!query) {
     742        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     743        return false;
     744    }
     745
     746    if (config->where) {
     747        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "pzDoneImfile");
     748        psStringAppend(&query, " AND %s", whereClause);
     749        psFree(whereClause);
     750    }
     751
     752    if (!p_psDBRunQuery(config->dbh, query)) {
     753        psError(PS_ERR_UNKNOWN, false, "database error");
     754        psFree(query);
     755        return false;
     756    }
     757    psFree(query);
     758
     759    if (psDBAffectedRows(config->dbh) < 1) {
     760        psError(PS_ERR_UNKNOWN, false, "should have affected atleast 1 row");
     761        return false;
     762    }
     763
    739764    return true;
    740765}
Note: See TracChangeset for help on using the changeset viewer.