Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index order
Message
De
25/08/2006 13:56:57
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
25/08/2006 13:25:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01148655
Message ID:
01148667
Vues:
21
>Hi.
>I have a table named 'artigos' with a .cdx index with three index keys:
> CODIGO_PRO - Numeric
> DESIGNACAO - Character
> DATA_REGIS - Date
>
>If I want to order the records by CODIGO_PRO is: "SET ORDER TO TAG CODIGO_PRO IN artigos".
>But, CODIGO_PRO is a code for a type of product. Of course I have all the products of each type together.
>Now, if I want the DESIGNACAO key to be my second order key how I say that CODIGO_PRO is my first order key and after ordering by CODIGO_PRO the records must be ordered by DESIGNACAO (my second index key)?

Do you really need to use the table directly? Can't you select from it into a cursor, and have that cursor ordered by codigo_pro, designacao?

You can have a temporary index on transform(codigo_pro, "99999999")+designacao, but temporary indexes are a hassle - you have to create them, make sure their names are unique (i.e. no two users trying to create the same index at the same time on the same machine), and you need to take care to delete them later. Much easier if you do something with a cursor - no cleanup, it vanishes with all of its indexes when closed.

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