Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement