Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very complicated index expression
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Very complicated index expression
Divers
Thread ID:
00605398
Message ID:
00605398
Vues:
64
Hi everybody,

We store names in this format FirstName Initial(1)=LastName=Suffix (Char 25), e.g.
James H=Smith=3rd
Nelson W=Smith, etc.

Here is a current index expression:
index on ;
UPPER(PADR(TRIM(SUBSTR(OWNER1,AT("=",OWNER1)+1))+ ;
IIF(AT("=",OWNER1)>0,LEFT(OWNER1,AT("=",OWNER1)-1),""),25)) ;
tag name1
However, this index expression doesn't correctly work with names with suffix.

I have separate UDF functions like GetLName, GetFName, however, I don't think it's a good idea to use UDFs in Index expression. So, could you please help me with modifying the current one to properly work with suffixes. Also here is another potential problem, if index expression becomes longer than 255 chars...
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform