Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Last Updated User
Message
 
 
À
19/02/2005 04:19:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
00988451
Message ID:
00988638
Vues:
52
Gregory,

How would I distingush between insert and update? I don't want to change these fields if it's a new record. I only want to update them if I'm changing the record. Also is there an easy way to find the PK field?

>Nadya,
>
>I think you can do so in the RecordValidation rule of the base tables
>
>You can use getfldstate(-1)
>
>For inserts, just replace tLast_Updated_Date and cLast_Updated_User
>
>For updates, loop using getfldstate(-1) and if getfldstate(-1) indicates a change for a field, compare the fieldvalue to the oldval() in case a field is changed and reset to its old value
>
>The only drawback is that the RecordValidation rule does not fire for a delete as far as I can see. Don't know whether that is a problem for you
>
>
>>Hi everybody,
>>
>>In our tables we have tLast_Updated_Date and cLast_Updated_User fields. How can we update these fields if we change our tables? Is it possible to do in a view? What if the view consists of several tables and two of them needs to be updated?
>>
>>How do you solve this problem?
>>
>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform