Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Update too slow
Message
From
07/02/2000 10:00:49
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00327310
Message ID:
00328238
Views:
34
There is a 1 to 1 relation between the table and the cursor and the cursor consists of a set of records with unique pk.
So I need to step the cursor record by record in order to know which record in the table to update.

>You do not need SCAN and ENDSCAN. The WHERE clause will update all matching records in the table. Use SCAN and ENDSCAN when you need to process records 1 at a time. SCAN/ENDSCAN is the same as DO WHILE NOT EOF(), SKIP, ENDDO without the need for the SKIP command.
>
>>I did like this:
>>
>>SELECT 'CURSOR'
>>SCAN
>> UPDATE 'TABLE' SET 'FIELD' = 'VALUE' WHERE 'PK_TABLE' = 'CURSOR.PK_CURSOR'
>>ENDSCAN
>>
>>This is really fast takes only a few secs to complete.
>>
>>>I'm gonna try the standalone IDX and if that doesn't help I'm gonna use the good old SCAN. Thanks for the help.
>>>
>>>>Did you try both a standalone IDX and then a CDX tag? If that didn't help, then you may want to use good old DML stuff like:
>>>>
>>>>SELECT cursor
>>>>SCAN
>>>> SELECT table
>>>> SEEK cursor.pk_field
>>>> REPLACE table.field WITH "whatever"
>>>> SELECT cursor
>>>>ENDSCAN
>>>>
>>>>>It didn't help at all it still takes about 15 mins to complete the UPDATE.
>>>>>This shouldn't take that long? Perhaps the problem is the SUB SELECT?
Magnus Nordin
VFP MCP

"We have tested the GUI on 5-year olds. Why? Beacuse they aren't braindead!"
Michael Spindler, Apple

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform