Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simulating EBCDIC sort with vfp index
Message
De
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:
00470118
Vues:
32
>For those who don't recall, EBCDIC is the ancient char system that orders like this in a natural ascending string sort:
>
>1) lower alpha
>2) upper alpha
>3) digits
>
>Quite the opposite of ASCII. Anyone think of a way to simulate this sort with a vfp index, on a field with mixed alphanumeric as below? These strings are varying in length, and I really want a structural index for this, not SQL or looping techniques involving code. I may be barking up the "impossible tree" here, but sometimes a fresh perspective can see some idea someone else has missed...
>
>For example, given this sequence:
>
>12G5A77
>123C6H
>12AB5
>123C6h
>
>I want to get:
>
>12AB5
>12G5A77
>123C6h
>123C6H

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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform