Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Update too slow
Message
 
 
To
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:
00328242
Views:
36
DOH! I see that now. You are scanning 'CURSOR' but updating 'TABLE' based on field value in 'CURSOR'. Next time I will read a little closer.

>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?
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform