Changeset 23544
- Timestamp:
- Mar 26, 2009, 8:58:47 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/regtool.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtool.c
r23500 r23544 319 319 320 320 psMetadata *where = psMetadataAlloc(); 321 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 322 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 323 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 321 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 322 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 323 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 324 PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "dateobs", ">="); 325 PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "dateobs", "<="); 324 326 325 327 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); … … 447 449 PS_ASSERT_PTR_NON_NULL(config, false); 448 450 451 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false); 452 PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false); 453 454 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 455 PXOPT_LOOKUP_F64(user_1, config->args, "-user_1", false, false); 456 457 if ((code == INT16_MAX) && !isfinite(user_1)) { 458 psError(PS_ERR_UNKNOWN, false, "one of -code or -user_1 must be selected"); 459 return false; 460 } 461 if ((code != INT16_MAX) && isfinite(user_1)) { 462 psError(PS_ERR_UNKNOWN, false, "only one of -code or -user_1 must be selected"); 463 return false; 464 } 465 449 466 psMetadata *where = psMetadataAlloc(); 450 467 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 451 468 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 452 469 453 PXOPT_LOOKUP_S16(code, config->args, "-code", true, false); 454 455 if (!pxSetFaultCode(config->dbh, "rawImfile", where, code)) { 456 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 457 psFree (where); 458 return false; 470 if (code != INT16_MAX) { 471 // this is fairly dangerous : can set all if the where is not set... 472 if (!pxSetFaultCode(config->dbh, "rawImfile", where, code)) { 473 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 474 psFree (where); 475 return false; 476 } 477 } 478 479 if (isfinite(user_1)) { 480 psString query = pxDataGet("regtool_updateprocessedimfile.sql"); 481 if (!query) { 482 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 483 return false; 484 } 485 486 if (!p_psDBRunQueryF(config->dbh, query, user_1, exp_id, class_id)) { 487 psError(PS_ERR_UNKNOWN, false, "database error"); 488 psFree(query); 489 return false; 490 } 491 psFree(query); 459 492 } 460 493 psFree (where);
Note:
See TracChangeset
for help on using the changeset viewer.
