Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating one column of many records CA
Message
 
 
To
22/05/2017 05:36:17
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01651281
Message ID:
01651305
Views:
43
>>Hi,
>>
>>I have yet another question on Cursor Adapter. Almost all my program updates are done using Cursor Adapter.
>>
>>I am looking at this case where one field of the SQL Server table has to be updated. The number of records is unknown but could vary from several hundred to several thousand. I have never done update of a SQL Server table where the number of records in the CA cursor is greater than about 1000. But in this case, it could be several times more (even up to 10,000). Note that only one field will be changed in the CA cursor and therefore send back for update. Does it matter? That is, would it make a difference for the reliability of such update (time is not important, a few more seconds or even a minute is ok) when one field has been changed or more than one field?
>
>Use a subclassed cursoradapter and then in the debugger check the SQL statement it creates (in .beforeupdate()). I think the only difference would be the number of fields included in the statement, which is IIRC based on getfldstate() values. So the statement will be shorter if fewer fields. I don't see much of a difference otherwise. Ah and make sure you use the wheretype=1 (just pk) because the default is 3 (pk and changed fields) which can create quite a lengthy where clause, including oldval() of each changed field.

What I did last night (kind of in line with what you are saying) is created a separate BIZ object for this table with only 3 fields that will be included in the CA cursor (PK, field by which the CA is filled, and the field that has to be updated). This way the Statement that updates the SQL DB table is much shorter.
But I don't know (don't understand) what you mean by "wheretype=1 because the default is 3". Where, in the CA, do I see this "1" and "3"?
And thank you for your input.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform