Changeset 7370 for trunk/MagicSoft/Mars/datacenter/macros
- Timestamp:
- 09/29/05 19:21:55 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/macros
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C
r7275 r7370 186 186 187 187 //getting # of sequence (in sequDB) between from and to 188 TString query("SELECT fSequenceFirst FROM Sequences WHERE fSequenceFirst ");189 query += Form("BETWEEN %d and %d OR fSequenceLast BETWEEN %d and %d ",190 from, to, from, to);188 TString query("SELECT fSequenceFirst FROM Sequences WHERE (fSequenceFirst "); 189 query += Form("BETWEEN %d and %d OR fSequenceLast BETWEEN %d and %d) AND " 190 "fManuallyChangedKEY=1 ", from, to, from, to); 191 191 192 192 TSQLResult *res = serv.Query(query); … … 212 212 { 213 213 case 0: 214 //FIXME: like this the check is of no use, but when doing it 215 // without the check for manuallychanged, all manually 216 // changed sequences would be deleted 214 217 cout << "found no sequence in Sequ-DB -> check other tables" << endl; 215 218 cout << " deleting every sequence found in Calibration, Star or SequenceProcessStatus between " … … 217 220 218 221 //calibration table 219 query=Form("SELECT fSequenceFirst FROM Calibration WHERE fSequenceFirst BETWEEN %d and %d", from, to); 222 query=Form("SELECT fSequenceFirst FROM Calibration " 223 " LEFT JOIN Sequences ON Calibration.fSequenceFirst=Sequences.fSequenceFirst " 224 " WHERE fManuallyChangedKEY=1 AND fSequenceFirst BETWEEN %d and %d", 225 from, to); 220 226 res = serv.Query(query); 221 227 if (!res) … … 231 237 232 238 //Star table 233 query=Form("SELECT fSequenceFirst FROM Star WHERE fSequenceFirst BETWEEN %d and %d", from, to); 239 query=Form("SELECT fSequenceFirst FROM Star " 240 " LEFT JOIN Sequences ON Star.fSequenceFirst=Sequences.fSequenceFirst " 241 " WHERE fManuallyChangedKEY=1 AND fSequenceFirst BETWEEN %d and %d", 242 from, to); 234 243 res = serv.Query(query); 235 244 if (!res) … … 245 254 246 255 //SequenceProcessStatus table 247 query=Form("SELECT fSequenceFirst FROM SequenceProcessStatus WHERE fSequenceFirst BETWEEN %d and %d", from, to); 256 query=Form("SELECT fSequenceFirst FROM SequenceProcessStatus " 257 " LEFT JOIN Sequences ON SequenceProcessStatus.fSequenceFirst=Sequences.fSequenceFirst " 258 " WHERE fManuallyChangedKEY=1 AND fSequenceFirst BETWEEN %d and %d", 259 from, to); 248 260 res = serv.Query(query); 249 261 if (!res) … … 801 813 802 814 TList sequlist; 803 query=Form("SELECT fSequenceFirst FROM Sequences WHERE %s order by fSequenceFirst",815 query=Form("SELECT fSequenceFirst FROM Sequences WHERE fManuallyChangedKEY=1 AND %s order by fSequenceFirst", 804 816 cond.Data()); 805 817
Note:
See TracChangeset
for help on using the changeset viewer.