>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.