Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
85 selects on a large database - looking for a way to si
Message
De
28/07/1999 10:58:19
 
 
À
28/07/1999 10:22:56
Dag Arneson
Cornell Univerity Hotel School
Ithaca, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00247128
Message ID:
00247159
Vues:
33
I've been thinking about this alot. Bear with me... If you had a cursor called labs and a cursor called hours, could you do the same thing, except maybe with a group clause? Then you could just issue a single select statement into a cursor that would actually be useful :-)

>I am trying to create a report for use of a computer lab. There are 5 separate sub-labs which I want to separate, and 17 different hours, 8 am - 12 midnight. The way I am currently using uses 17 * 5 or 85 select statements. As the log file size increases, these select statements could take quite a while. Is there a better (faster) way to do this?
>
>
>FOR labnum = 1 to 5
>  FOR hournum = 8 TO 24
>    SELECT uselog.time_in, uselog.time_out, computer.res_loc ;
>      FROM uselog INNER JOIN computer ;
>      ON ((uselog.comp_id = computer.res_id) AND (computer.res_loc = labnum) AND ;
>      (BETWEEN(DTOT(gdreportdate)+(hournum*3600), uselog.time_in, uselog.time_out))) ;
>      INTO CURSOR useless  && So a browse window doesn't pop up
>    gausage[labnum, hournum - 7] = _TALLY
>    SELECT useless
>    USE
>   ENDFOR
>ENDFOR
>
--Todd Sherman
-Wake Up! Smell the Coffee!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform