Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace vs Sql Update()
Message
De
03/11/2006 10:09:55
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01166701
Message ID:
01166891
Vues:
12
Only 1 record is being updated. But about 20 fields in this record need replacing. Which would be faster, the XBase REPLACE or the SQL-Update()?

Thanks,

Jerry


>The UPDATE-SQL willl be slow if it updates multiple records because it locks/unlocks each record. The REPLACE command places lock on the table for the duration of execution.
>
>>Which is better between #1 and #2 below and is there a big performace difference between the two.
>>
>>1.) Performing 20 of these commands:
>> REPLACE myfield1 WITH var1 IN mytable
>> REPLACE myfield2 WITH var2 IN mytable
>> REPLACE myfield3 WITH var3 IN mytable
>> etc...
>>
>>VS
>>
>>2.) Performing 1 of these commands:
>>UPDATE mytable SET field1 = var1, field2 = var2, etc...
>> WHERE myprimaryfield = somekey
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform