IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16364


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

add pztool -revertcopied mode

Location:
trunk/ippTools
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/Makefile.am

    r15955 r16364  
    5555        pztool_find_completed_exp.sql \
    5656        pztool_pendingimfile.sql \
     57        pztool_revertcopied.sql \
    5758        regtool_pendingexp.sql \
    5859        regtool_pendingimfile.sql \
  • 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.