Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find record position in an indexed table
Message
De
24/08/2006 17:13:15
 
 
À
24/08/2006 16:10:36
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01148310
Message ID:
01148386
Vues:
16
>>>Hello,
>>>
>>> How to find the position of a record in an indexed table.
>>>RECNO() will give the position of the record in the table but how to find the position in an indexed table.
>>>
>>>TIA
>>
>>For Versions of VFP previous to 9, if the table is small (under 65,000 rows), you could do a SQL SELECT of the primary keys into an array in the order of the index key. Then do an ASCAN to find your primary key. The element of the array would be the indexed order.
>
>Fred! That's brilliant!
>

Sure ?
ASCAN is equal to a ordered count

>You could expand that to a cursor! select pk order by indexkey. locate for pk = m.pk
>

If you want gain something:
SELECT pk from table order by 1 ...
INDEX ON pk tag tagpos && without this, the locate is equal to the ordered count, again
SEEK m.pk
? recno()
>recno is then the relative position.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform