Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SEEK or SEEK()with cursors??
Message
De
19/08/1998 11:37:28
 
 
À
19/08/1998 10:00:18
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00127371
Message ID:
00128151
Vues:
41
>>>>>Josh,
>>>>>
>>>>>I'm not entirely sure how to index a cursor, the ones I'm using come from an SQL-Select statement
>>>>>
>>>>>Perry
>>>>
>>>>Perry,
>>>>
>>>>You cannot index a cursor created with a SQL select statement, because it is a readonly cursor. You should SELECT to an array and create a cursor with CREATE CURSOR. Then use normal indexing commands on the cursor. Appen from the array to the cursor.
>>>
>>>Not correct. You can build an index on the cursor.
>>
>>Partially correct. You can create ONE index on an SQL select cursor.
>
>You can create ONE _structural_ index, but you can create any indexes you want if they're not structural, i.e. not in the default file, but in a separate .cdx file. My standard procedure for this is
>
>lcCdx=lcSortWork+sys(3)
>
>index on [whatever] tag Tag1 of (lcCdx)
>index on [whatever] tag Tag2 of (lcCdx)
>index on [whatever] tag Tag3 of (lcCdx)

Now that is correct! Thanks for pointing that out, I hadn't really considered that method of doing things, mainly because of the house keeping involved.
If you make your SQL select cursor R/W, you can create more than one tag in the structural CDX. However, this CDX will not automatically remove itself when the cursor is closed, even though it still has the same (root) name! It's still pretty easy to remove this file when you close the cursor and you don't have to worry about "scoping" on the variable for your separate CDX file name.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform