Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update
Message
 
To
11/02/2003 04:34:57
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: Update
Miscellaneous
Thread ID:
00751813
Message ID:
00751848
Views:
17
I think, this will behave better:

SELECT * FROM prodarea;
INTO CURSOR tmpLoad;
ORDER BY 1,2;
NOFILTER

INDEX ON PROD + "x" TAG PROD

sele xxx
set rela to po_code + po_docode into tmpLoad
repl po_area with tmpLoad.area for not eof("tmpLoad") and po_area#tmpLoad.area

Depending on table or cursor has more records you may also benefit when having index in XXX and reverse relations:

use xxx excl
index on po_code + po_docode tag prod
sele tmpLoad
set rela to PROD + "x" into xxx
set SKIP to xxx
repl xxx.po_area with tmpLoad.area for xxx.po_area # tmpLoad.area and not eof("xxx")



>Hi all,
>
>I have the following problem with a SQL update:
>
>I populate a temp table and put it threw a SCAN to update my relevant table,it is very slow and would love to speed it up.Is there any way with the current indexes to do so?The speed is about one record every 1 second.
>
>
>SELECT * FROM prodarea;
> INTO CURSOR tmpLoad;
> ORDER BY 1,2;
> NOCONSOLE
> INDEX ON PROD + area TAG PROD
>
>cCounter = 0
>
>SCAN
>
>cCounter = cCounter + 1
>
> UPDATE xxx;
> SET po_area = tmpLoad.area;
> WHERE po_code = tmpLoad.PROD AND;
> po_docode = "x"
>
>
>
>
>WAIT WINDOW "Files Updated: " + STR(cCounter) NOWAIT
>
>ENDSCAN
Previous
Reply
Map
View

Click here to load this message in the networking platform