Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need assistance optimizing a select statement
Message
 
 
À
02/12/2003 13:16:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00855104
Message ID:
00855312
Vues:
14
Neil,
>  Ufrag = '%'+UPPER(tcLastNameFragment)+'%' ;
>  cnLEN = TRANSFORM(LEN(tcLastNameFragment));
>  SUBY = " SUBSTR(UPPER(title),1," + cnLEN + ") like '" ;
LIKE %something% is not optimizeable.

LIKE something% is optimizeable using an index on lastname

>If I pass "GOR" to the method, the select statement will return 3 the following 3 names as it should:
>GORE
>GORIN
>GORY
>
>If I pass in "T" to the method, every name that starts with "T" is found.
>Select statement works but lacks opitimization.

If you really only want names that start with the fragment

uFrag = upper( alltrim( tcLastNameFragment ) )
[where upper(lastname) = '] + uFrag + [']

should work for you.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform