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:
00751860
Vues:
14
>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

The index on this cursor serves no purpose.

>
>cCounter = 0
>
>SCAN
>
>cCounter = cCounter + 1
>

This is where you need the index... and if you create a similar index as above, you need to use the exact same filter in your WHERE.
So... if you do
INDEX ON po_code + po_docode TAG someTag

your WHERE should be something like this
WHERE po_code + po_docode = tmpLoad.PROD + 'x'


> UPDATE xxx;
> SET po_area = tmpLoad.area;
> WHERE po_code = tmpLoad.PROD AND;
> po_docode = "x"
>
>
>
>
>WAIT WINDOW "Files Updated: " + STR(cCounter) NOWAIT
>
>ENDSCAN
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform