Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update - Replace
Message
De
08/03/2006 12:39:41
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01102507
Message ID:
01102517
Vues:
16
>Hi
>
>If I have two fields being changed in an update or replace statement is it valid to rely on a the changed value of the first field in the statement when setting the second or should I always do two passes?
>
>eg.
UPDATE mytable SET ;
>	field1 = CalcForwardTime(), ;
>	field2 = OtherCalc(field1)
>
>Regards
>Geoff Scott

Nice question.

I'd be inclined to compute their vals before the update, e.g.
lcField1 = CalcForwardTime()
lcField2 = OtherCalc( lcfield1)
Update MyTable set field1 = lcField1, ;
                   field2 = lcField2
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform