Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select command to highlight missing Numbers
Message
De
22/04/2008 12:42:20
 
 
À
22/04/2008 11:48:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01311939
Message ID:
01312420
Vues:
14
>I'm going to give that a try. I like this approach, as defining the gaps is my desired result. Unfortunately, this is the smallest of 8 tables that I need to look at.
>
>>Hmm, too bad. I never had to run it on more than about 40K records and worked fine there. Could you process the main file in smaller chunks?

Maybe this would work better, plain old xbase style code:
CREATE CURSOR gaps (gapstart i, gapend i)
SELECT sequence
GO TOP
nstart = nval - 1
nend = nstart
SCAN ALL
  IF nstart+1=nval
    nstart = nval
    LOOP
  ENDIF
  IF nstart<nval
    nstart = nstart + 1
    nend = nval - 1
  ENDIF
  INSERT INTO gaps VALUES (nstart,nend)
  nstart = nval
ENDSCAN
40K records takes about .08 seconds.
400K takes about .67 seconds.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform