Changeset 71
- Timestamp:
- 10/30/2008 11:11:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SH_SHM/trunk/source/sqliface.c
r46 r71 3 3 * ========== 4 4 * 5 * $Revision: 31 $, $Date: 2008-03-03 20:47:24 +0100 (Mo, 03 MÀr2008) $5 * $Revision: 56 $, $Date: 2008-10-28 16:01:29 +0100 (Di, 28 Okt 2008) $ 6 6 * 7 7 * Interface to SQL databases … … 188 188 char tmpfile[cBcFileLth+1]; /* scratch file, not used */ 189 189 NTIME sntime, entime; /* numeric read times */ 190 NTIME soffset, eoffset; /* limitation of search range */ 190 191 int datea, dateb; /* dates of seed entry */ 191 192 double timea, timeb; /* times of entry */ 192 193 int rd1date, rd2date; /* read date as integer */ 193 194 double rd1time, rd2time; /* read time as double */ 195 int rd1off, rd2off; /* date part of soffset, eoffset */ 194 196 195 197 /* executable code */ … … 207 209 /* call to db if new start time given */ 208 210 if (strcmp(start,last_start) != 0 || readlth != last_readlth) { 211 tc_nadd( &sntime, -86400*30*3, &soffset, status ); 212 if (SySevere(status)) return; 213 tc_nadd( &entime, 86400*30*3, &eoffset, status ); 214 if (SySevere(status)) return; 209 215 rd1date = sntime.year*10000 + sntime.month*100 + sntime.day; 210 216 rd1time = (double)sntime.hour*10000.0 + (double)sntime.min*100.0 … … 213 219 rd2time = (double)entime.hour*10000.0 + (double)entime.min*100.0 214 220 + (double)entime.sec + (double)entime.ms/1000.0; 221 rd1off = soffset.year*10000 + soffset.month*100 + soffset.day; 222 rd2off = eoffset.year*10000 + eoffset.month*100 + eoffset.day; 215 223 sprintf( shellcmd, 216 "\\rm %s; %s %s \"select %s from sftab where (((edate > %d) OR (edate = %d AND etime >= %10.3lf)) AND ((sdate < %d) OR (sdate = %d AND stime <= %10.3lf))) ORDER BY sdate,stime\" %s >%s",224 "\\rm %s; %s %s \"select %s from sftab where edate < %d and sdate > %d and ((edate > %d) OR (edate = %d AND etime >= %10.3lf)) AND ((sdate < %d) OR (sdate = %d AND stime <= %10.3lf)) ORDER BY sdate,stime\" %s >%s", 217 225 sqlv_sfdb_tmp, GpGetString(cGpS_sfdb_command), 218 GpGetString(cGpS_sfdb_exec_qual), TABLE_ELEMENTS, rd 1date, rd1date,219 rd1 time, rd2date, rd2date, rd2time, GpGetString(cGpS_sfdb_trailer),220 sqlv_sfdb_tmp );226 GpGetString(cGpS_sfdb_exec_qual), TABLE_ELEMENTS, rd2off, rd1off, 227 rd1date, rd1date, rd1time, rd2date, rd2date, rd2time, 228 GpGetString(cGpS_sfdb_trailer), sqlv_sfdb_tmp ); 221 229 if (GpGetInt(cGpI_debug_level) > 2) 222 230 printf( "SH-dbg3: executing %s\nSH-dbg3: command line length %d\n",
Note: See TracChangeset
for help on using the changeset viewer.