Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know if I changed the field
Message
De
12/02/2004 17:27:58
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
How to know if I changed the field
Divers
Thread ID:
00876888
Message ID:
00876888
Vues:
52
We are sharing information between our app and another app both importing and exporting from SQL. When we are done importing they want to export the information. So we decided to have a field in a one record SQL table to determine when we could import/export. So if they field is 'N' that means they are done with the export. If the field is 'Y' then we are done with the import. If the field is 'X' then one of us is process of doing an update. So for the import the field would go from an (N->X->Y) then they would set the field back to (Y->X->N).

So I initally thinking that I could issue the following statement and check to see if schedstat is 'X' to see if I could import.
UPDATE SCHEDULE SET SCHEDSTAT = 'X' WHERE SCHEDSTAT = 'N'
The problem is that what if it's already an 'X'. How can I tell if I changed the value or not? If I check first then try the update - there is a small chance that they could have updated it to an 'X' first.

We are using VFP6 with SPT
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform