Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A NICE message when Primary Key is violated
Message
 
 
À
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:
00503777
Vues:
24
>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.

Walter,

Could you please expand the option 2 here?

It unfortunately will lead to the chages in our framework, which our manager very hesitant to do :(
>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,
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform