Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The right way to lookup/validate
Message
De
21/11/2004 21:01:08
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
The right way to lookup/validate
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
00963381
Message ID:
00963381
Vues:
40
HI,
I have a general question on the correct way to do a lookup/validation. I have been using a simple "Select cust_id from customer where cust_id = myvar". Where myvar comes from a routine that was saving a record and making sure I didn't violated a unique key (user entered). But I actually had two users have a conflict where an error message was returned from the SQL server. IOW I had two users that attempted to save a record and both passed the select statement and continued to save (of course only one actually saved the record). So what's the recommended way to validate the unique key prior to attempting to save the record? I was thinking that a SP might work where it would return a false/true which would be a little faster and therefore limit the conflict. Or may the SP could add a record with the key field and then return the record number. Or does everyone just attempt the save and handle the error message?

Any help - thanks

John
John Fabiani
Woodland, CA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform