Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Confused about how VFP handles tableupdates.
Message
De
13/10/2000 16:12:22
 
 
À
13/10/2000 15:47:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00429328
Message ID:
00429346
Vues:
24
>Do I in some way use GETNEXTMODFIED(0) and GETFLDSTAT(-1) together or use one or the other but not both?
>
>If use only one of them, which if more preferable?
>
>just a little confused.
>
>thnaks bunch

GETNEXTMODIFIED() finds the next modified record in a table buffer.

GETFLDSTATE() will tell you the fields that were modified in a row with either type of buffering - also if it was a new record or not.

So, you would only need to use them both together on a table buffered cursor, where you need to
1) Find if there is a modified row - GETNEXTMODIFIED(0)
2) See which fields were actually modified in that row - GETFLDSTATE(-1).

This could be useful in a number of ways: (these are wild ass answers, but it's to make a point <g>)

a) Say this was a SQLEXEC() result cursor you've set to use table buffering - you've changed things, but you only want to build the UPDATE statement with the modified fields.
You could now loop through the GETFLDSTATE() result looking for 2's.

b) Some validation needed - e.g., Status can't be Employed if Termination Date is empty.
Now you can revert just this record, bail out, or log an error for this record and update the other changed records (if they're valid) individually.
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform