Changeset 14147
- Timestamp:
- Jul 11, 2007, 3:01:27 PM (19 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 2 edited
-
share/camtool_find_pendingexp.sql (modified) (1 diff)
-
src/camtool.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/camtool_find_pendingexp.sql
r14027 r14147 2 2 -- does a little more work then is necessary for -addprocessed but it seems 3 3 -- "cleaner" to use the same query for both cases 4 SELECT 5 camRun.*, 6 rawExp.exp_tag, 7 rawExp.exp_id, 8 rawExp.exp_name, 9 rawExp.camera, 10 rawExp.telescope, 11 rawExp.filelevel 12 FROM camRun 13 JOIN chipRun 14 USING(chip_id) 15 JOIN chipProcessedImfile 16 USING(chip_id) 17 JOIN rawExp 18 ON chipProcessedImfile.exp_id = rawExp.exp_id 19 LEFT JOIN camProcessedExp 20 ON camRun.cam_id = camProcessedExp.cam_id 21 LEFT JOIN camMask 22 ON camRun.label = camMask.label 23 WHERE 24 chipRun.state = 'stop' 25 AND camRun.state = 'run' 26 AND camMask.label IS NULL 27 AND camProcessedExp.cam_id IS NULL 4 SELECT * FROM 5 (SELECT 6 camRun.*, 7 rawExp.exp_tag, 8 rawExp.exp_id, 9 rawExp.exp_name, 10 rawExp.camera, 11 rawExp.telescope, 12 rawExp.filelevel 13 FROM camRun 14 JOIN chipRun 15 USING(chip_id) 16 JOIN chipProcessedImfile 17 USING(chip_id) 18 JOIN rawExp 19 ON chipProcessedImfile.exp_id = rawExp.exp_id 20 LEFT JOIN camProcessedExp 21 ON camRun.cam_id = camProcessedExp.cam_id 22 LEFT JOIN camMask 23 ON camRun.label = camMask.label 24 WHERE 25 chipRun.state = 'stop' 26 AND camRun.state = 'run' 27 AND camMask.label IS NULL 28 AND camProcessedExp.cam_id IS NULL 29 ) as Foo -
trunk/ippTools/src/camtool.c
r14100 r14147 590 590 } 591 591 592 if (!p_psDBRunQuery(config->dbh, query, cam_id)) { 592 { 593 // build a query to search by cam_id 594 psMetadata *where = psMetadataAlloc(); 595 if (cam_id) { 596 if (!psMetadataAddS64(where, PS_LIST_TAIL, "cam_id", 0, "==", (psS64)atoll(cam_id))) { 597 psError(PS_ERR_UNKNOWN, false, "failed to add item cam_id"); 598 psFree(where); 599 psFree(query); 600 return false; 601 } 602 } 603 604 psString whereClaus = psDBGenerateWhereSQL(where, NULL); 605 psFree(where); 606 if (whereClaus) { 607 psStringAppend(&query, " %s", whereClaus); 608 psFree(whereClaus); 609 } 610 611 } 612 613 if (!p_psDBRunQuery(config->dbh, query)) { 593 614 psError(PS_ERR_UNKNOWN, false, "database error"); 594 615 psFree(query);
Note:
See TracChangeset
for help on using the changeset viewer.
