Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simulating EBCDIC sort with vfp index
Message
 
À
30/01/2001 11:39:04
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00470093
Message ID:
00470307
Vues:
41
>I seem to remember something like sys(15), which actually needs a 256-character string and performs an equivalent of chrtran() on your key, but we did use that to achieve our national collationg sequence back in foxplus days. The only trouble is 1) you have to build this translation string, and 2) it needs to be in memory whenever you try to open the table using such a key.
>If that's OK with you, index on sys(15,your_field, your_tran_string) tag yadayada, or something like that.

Thanks Dragan, you got me thinking in the right direction, I had to map out 1-1 sequence of ASCII to EBCDIC that would give a proper sort translation. This is about the ugliest index I can ever recall seeing, but it seems to work in preliminary testing:

INDEX ON CHRTRAN(myfield,'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz','qrstuvwxyzabcdefghijklmnopQRSTUVWXYZ !#$%&()*+ABCDEFGHIJKLMNOP') TAG mytag

Other translation sequences are possible, but this one seemed especially ugly, so what the heck, might as well have some fun coding :-) Have to test a little more, though...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform