Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update
Message
 
À
11/02/2003 04:34:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Update
Divers
Thread ID:
00751813
Message ID:
00751848
Vues:
11
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform