Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A NICE message when Primary Key is violated
Message
De
04/05/2001 14:52:23
Walter Meester
HoogkarspelPays-Bas
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00503380
Message ID:
00503713
Vues:
21
Nadya

>I have this situation. We have a Lender table with Code (Char 6) made as PK. This table has already one record with empty code (by design). Now I can't issue APPEND BLANK. What would be your advice in this situation?

Three possibilities come up in mind:
1. Use SQL - INSERT
2. Use Record or tablebuffering and commit the insert with tableupdate.
3. Using a default value (in the table definition you can add a default value. It might also be handy to call a unique key generation routine here)

Number two has the advantage of having the possibility of handling errors when they occur at the insert (see Message #503704).

HTH

Walter,



>
>Thanks in advance.
>
>>John,
>>
>>>Ack!
>>aww
>>
>>>Kevin, don't do it! Don't base primary or candidate keys on user data!
>>
>>Well, I knew some people were against using intelligent primary keys, but I really wonder what's against intelligent candidate keys. Where do you want to use candidate keys. And more important how do you force a userdata value to be unique troughout the table ??
>>
>>Walter,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform