Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Increasing primary key integers in a table
Message
From
18/09/1998 10:17:38
 
 
To
18/09/1998 10:12:46
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00138182
Message ID:
00138187
Views:
12
>Hello,
>
>We are using Visual FoxPro 5.0 and we are building a framework. For our tables we want to use a primary key on an 'integer'-field. Is it possible to increase the integer automaticly every time we add a new record so we will get a surrogate primary key?
>
>Greetings,
>
>Afier Appelman

It's standard way: you have separate table 'setup.dbf' to store tablename and next available keyvalue. When application requests new key, it goes to this table, locates appropriate table name, locks this record, picks up the leyvalue, increments it, unlocks the record and returns keyvalue.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform