Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplicate Records in a Table
Message
De
21/11/1999 09:50:31
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
21/11/1999 00:13:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00293595
Message ID:
00293618
Vues:
24
Favio-

> the problem is that I don’t know how to validate that a record is not duplicated, because the record is already created when I try to validate the key. ( I guess for buffering )

I suggest the following as a possible option:

1. Use surrogate (not natural) candidate keys.
2. Use buffering to insert the record without committing it.
use myFreeTable
set multilocks on
cursorsetprop('buffering',5)
3. Generate the candidate key in code so you're always assured of uniqueness.
insert into myFreeTable (someIDfield) values (FunctionToGetID())

FunctionToGetID would return a valid primary key.

4. When you update your changes, check the return value, and if it was unsuccessful (TABLEUPDATE( 2 ) returns .F.), make the necessary correction.

5. If you can, read Effective Techniques for Application Development in Visual FoxPro 6.0 available through www.hentzenwerke.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform