Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary key
Message
From
21/03/2003 09:32:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
21/03/2003 09:24:33
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00766466
Message ID:
00768555
Views:
28
>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)
Previous
Reply
Map
View

Click here to load this message in the networking platform