Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Incremental search on numeric
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00774073
Message ID:
00774466
Vues:
10
Thank you Sergey,

Your method may just be the shortest code available.

Tracy

>Hi Tracy,
>
>It could be slow if your table is big. I would rather use SEEK()
>CREATE TABLE SORTTEST (SKNO N(4))
>INSERT INTO SORTTEST VALUES (250)
>INSERT INTO SORTTEST VALUES (350)
>INSERT INTO SORTTEST VALUES (6300)
>INSERT INTO SORTTEST VALUES (650)
>INSERT INTO SORTTEST VALUES (60)
>INDEX ON SKNO TAG SKNO
>INDEX ON STR(SKNO,4) TAG SKNOZ
>INDEX ON PADR(TRANSFORM(SKNO),4) TAG SKNOA
>
>** When I need to do an incremental search.
>nUserinput = 6
>
>SET ORDER TO sknoZ
>= SEEK(STR(nUserinput, 4)) ;
>		OR SEEK(STR(nUserinput, 3)) ;
>		OR SEEK(STR(nUserinput, 2)) ;
>		OR SEEK(STR(nUserinput, 1))
>		
>SET ORDER TO sknoA		
>
>
>>Here's a thought how much speed loss do you think I would get with this.
><snip>
Tracy
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform