Changeset 26236 for branches/eam_branches/20091113/ippTools/src/disttool.c
- Timestamp:
- Nov 20, 2009, 4:13:39 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091113/ippTools/src/disttool.c
r26095 r26236 52 52 static bool definetargetMode(pxConfig *config); 53 53 static bool updatetargetMode(pxConfig *config); 54 static bool listtarget Mode(pxConfig *config);54 static bool listtargetsMode(pxConfig *config); 55 55 56 56 static bool definedestinationMode(pxConfig *config); … … 100 100 MODECASE(DISTTOOL_MODE_DEFINETARGET, definetargetMode); 101 101 MODECASE(DISTTOOL_MODE_UPDATETARGET, updatetargetMode); 102 MODECASE(DISTTOOL_MODE_LISTTARGET , listtargetMode);102 MODECASE(DISTTOOL_MODE_LISTTARGETS, listtargetsMode); 103 103 MODECASE(DISTTOOL_MODE_DEFINEDESTINATION, definedestinationMode); 104 104 MODECASE(DISTTOOL_MODE_UPDATEDESTINATION, updatedestinationMode); … … 1311 1311 } 1312 1312 1313 static bool listtarget Mode(pxConfig *config)1313 static bool listtargetsMode(pxConfig *config) 1314 1314 { 1315 1315 PS_ASSERT_PTR_NON_NULL(config, false); … … 1551 1551 PXOPT_COPY_STR(config->args, where, "-dist_group", "dist_group", "LIKE"); 1552 1552 PXOPT_COPY_STR(config->args, where, "-filter", "filter", "LIKE"); 1553 PXOPT_COPY_STR(config->args, where, "-stage", "stage", "=="); 1553 // if stage is all don't add it to the query (match all stages) 1554 if (stage && strcmp(stage, "all")) { 1555 PXOPT_COPY_STR(config->args, where, "-stage", "stage", "=="); 1556 } 1554 1557 1555 1558 psString query = pxDataGet("disttool_defineinterest.sql"); … … 1611 1614 PXOPT_COPY_S64(config->args, where, "-dest_id", "dest_id", "=="); 1612 1615 PXOPT_COPY_S64(config->args, where, "-target_id", "target_id", "=="); 1616 PXOPT_COPY_STR(config->args, where, "-dest_name", "rcDestination.name", "LIKE"); 1617 PXOPT_COPY_STR(config->args, where, "-filter", "filter", "LIKE"); 1618 PXOPT_COPY_STR(config->args, where, "-dist_group", "dist_group", "LIKE"); 1613 1619 1614 1620 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); … … 1618 1624 return false; 1619 1625 } 1620 psString query = NULL; 1621 psStringAppend(&query, "UPDATE rcInterest SET state = '%s'", state); 1626 psString query = pxDataGet("disttool_updateinterest.sql"); 1622 1627 1623 1628 if (psListLength(where->list)) { … … 1633 1638 psFree(where); 1634 1639 1635 if (!p_psDBRunQuery (config->dbh, query)) {1640 if (!p_psDBRunQueryF(config->dbh, query, state)) { 1636 1641 psError(PS_ERR_UNKNOWN, false, "database error"); 1637 1642 psFree(query); … … 1639 1644 } 1640 1645 psFree(query); 1646 1647 psS64 numUpdated = psDBAffectedRows(config->dbh); 1648 printf("updated %" PRId64 " interests\n", numUpdated); 1641 1649 1642 1650 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
