Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The best way to use a portion of a field for indexing
Message
De
11/01/2005 07:32:16
 
 
À
11/01/2005 07:20:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00975802
Message ID:
00975983
Vues:
28
>>>It is unnecessary.
>>>
>>>CREATE CURSOR byby (c c(2))
>>>INDEX on ALLTRIM(C)+ALLTRIM(C) TAG t1 && VFP build a key with LEN(KEY())=FSIZE('C')+FSIZE('C')
>>
>>Try with a blank record as your first record, and you will see the problem. All index expression must give a fixed length key!
>>
>
>Why before to say anything you don't try it?
>
>Where is the problem ? I don't look any problem here:
><pre>
>CREATE CURSOR byby (c c(2))
>INSERT INTO byby values ('')
>INDEX on ALLTRIM(C)+ALLTRIM(C) TAG t1 && VFP build a key with LEN(KEY())=FSIZE('C')+FSIZE('C')
>? SEEK('11')
>INSERT INTO byby VALUES ('12')
>INSERT INTO byby VALUES (' 2')
>? SEEK('1212')
>? SEEK('22')
>
>
>Fabio

I hope someone from Microsoft can comment on this, because their official comment has always been 'be sure to use fixed length keys for your indexes'.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform