Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to increment Autoinc field just when tableupdate
Message
From
03/12/2004 08:46:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
03/12/2004 07:04:30
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00966638
Message ID:
00966656
Views:
8
I think autoinc fields should only be used for "internal" codes which the end-user never sees. So, it doesn't really matter if numbers are skipped or not.

For additional codes which the user sees (for instance, document numbers), it is better to write your own function to fill the value. That, you might control in a form, and embed in a transaction (i.e., if the TableUpdate() fails, the number in the "sequence" table will be reset to its previous value).

If you don't have one already, I can search for my own version of this function, which I call SerialNumber().

>Because sometimes the user give up to include a record (revert) and that number of autoinc field is not used. It is not a problem, just a preference of user.
>
>>I don't think so because it would cause problem if 2 transactions occurs at the same time and that you need the autoinc field to do relation in your transaction.
>>
>>The real question is: why do you need the autoinc field to increment only when tapleupdate is issued?
>>
>>>I would like to increment autoinc field just when tableupdate is issued. Is it possible?
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