Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why only 1 index?
Message
De
15/03/2000 13:07:59
Walter Meester
HoogkarspelPays-Bas
 
 
À
15/03/2000 12:55:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00345950
Message ID:
00345957
Vues:
23
Michael,

This behaviour has to do with the readonly characteristics of the SQL-cursor. If a cursor is readonly you can't add an index *unless* an index tag does not exist already.

One possible solution is to use the cursor again in another alias,

USE (DBF("MyCursor")) AGAIN ALIAS MyCursor2

before you add the indexes.

Another might be to replace the SQL-SELECT by a SQL view which is read write by default.

Walter,

>
>I have a problem adding indexes to a cursor. Could someone please explain.
>
>When I do:
>
>nconhandle = sqlexec(nhandle, sqlstatement, 'mycursor' )
>
>*!* Validation on 'nconhandle'
>
>SELECT main_cursor
>INDEX ON user_invc_no TAG u_invc_no ADDITIVE
>INDEX ON invc_no TAG invc_no ADDITIVE
>SET ORDER TO invc_no
>
>Then later I do:
>
>SELECT * FROM mycursor WHERE ....... INTO CURSOR mycursor
>
>SELECT main_cursor
>INDEX ON user_invc_no TAG u_invc_no ADDITIVE && Allows this index
>INDEX ON invc_no TAG invc_no ADDITIVE && Won't allow this index
>SET ORDER TO invc_no
>
>error message says: File c:\temp\3mio000o.tmo is read only
>My question is why???
>
>If I press ignore the program continues. I could put an error handler around it but I'd like to understand what is going on 1st.
>
>TIA
>Mike
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform