Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code for Cursor Readwrite
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01057981
Message ID:
01058005
Views:
16
I have a huge amount of third party code that expects to use qm_cond. Qm_cond has gotten too large to remain open with all the records. So I am selecting off the records for a single unit, and putting them in qm_cond so that the rest of the code does not have to change.

USE qm_cond IN 0 ALIAS qm_cond_table
SELECT * FROM qm_cond_table into CURSOR qm_cond

this produces an Alias Name is Already in Use. Even though the alias is qm_cond_table, VFP will not let a cursor qm_cond get created because the qm_cond table is open.


>I would strongly recomend to modify your code to use a cursor name that is different from any existing table name. Otherwise you may unknowingly use cursor instead of table and vise verca. If you insist on doing that, try
USE IN ( SELECT("qm_cond"))
>USE IN ( SELECT("qm_cond_table"))
>
>
>USE qm_cond IN 0 ALIAS qm_cond_table
>
>SELECT * FROM qm_cond_table into CURSOR qm_cond READWRITE ;
>   WHERE f_query_id like qm_list.f_query_id+'%'
>INDEX ON F_QUERY_ID TAG F_QUERY_ID
>SET ORDER TO TAG F_QUERY_ID
>
>...
>
>SELECT qm_cond_table
>APPEND FROM DBF('qm_cond')
>
>
>>Looking for ways to make my code more efficient or at least not as embarressing.
>>
>>1) have a VFP free table1.dbf. Want to select records from table1.dbf and then end up with a readwriteable cursor called table1.dbf. Currently I have the following sloppy lines of code.
>>
>>
>>IF used("QM_cond")
>>   USE IN qm_cond
>>ENDIF
>>USE qm_cond IN 0
>>SELECT * FROM qm_cond into CURSOR temp READWRITE ;
>>   WHERE f_query_id like qm_list.f_query_id+'%'
>>USE IN qm_cond
>>SELECT * FROM temp INTO CURSOR qm_cond readwrite
>>USE IN temp
>>SELECT qm_cond
>>INDEX ON F_QUERY_ID TAG F_QUERY_ID
>>SET ORDER TO TAG F_QUERY_ID
>>
>>
>>
>>2) do some processing, then want to then update table1.dbf with the records from cursor table1. currently I am co
>>
>>SELECT * FROM qm_cond INTO CURSOR temp
>>USE IN qm_cond
>>USE c:\rt50vss\data\qm_data\qm_cond IN 0
>>DELETE FROM qm_cond WHERE f_query_id like qm_list.f_query_id+'%'
>>SELECT qm_cond
>>APPEND FROM DBF('temp')
>>USE IN temp
>>
>>
>>
>>Any suggestions are appreciated
>>
>>Brenda
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform