Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexing problem
Message
De
23/11/2004 09:19:24
 
 
À
23/11/2004 00:42:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
00963720
Message ID:
00963809
Vues:
7
>Dear Experts
>
>I have a table entitled TABLE2 contained three character type fields. On click event of command1, I have following codes
>
>SELECT table2
>INDEX ON ALLTRIM(mill)+ALLTRIM(bank)+ALLTRIM(branch) TO table21
>
>When I press command1, it shows following error message
>
>"Invalid key length"
>
>What is problem?
>How should I create this index?
>
>Please help

Tariq, don't use ALLTRIM() into a index key;
only with strange graph structures this can to be useful.

EXAMPLE:
mill,bank,brancH
'  AB   ','  CD  ','  E  ' => KEY:'ABCDE'
'  A   ','  BC  ','  DE  ' => KEY:'ABCDE'
Error occur because VFP evaluate the key expression for to compute the key lenght;
If this is not the max lenght case, a next key fire the error.

use:
mill+bank+branch

or ( !!!! i think you don't want this really )

mill-bank-branch

or
PADR(ALLTRIM(mill)+ALLTRIM(bank)+LTRIM(branch),millfsize+bankfsize...)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform