Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary key
Message
De
21/03/2003 09:32:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
21/03/2003 09:24:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00766466
Message ID:
00768555
Vues:
24
>Hi,
>Sorry to make you misunderstand. What I meant is.. something like invoice no.. INV00001, INV00002, TF100001, TF100002

Personally, I prefer to use only numbers for the primary keys. The user will not see the primary key.

You may still need numbers for the key the user sees. If you want to have the codes you mention above, you can assign the code in the form. Do it only when you save the record, and embed it in a transaction. This is to avoid skipping numbers (the user might start editing, and then cancel).

For the invoice, you can assign an expression like "INV" + SerialNumber("Invoice"), where SerialNumber is a function that does a lookup in a table of sequences.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform