Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regenerating Same ID Numbers for Different Entities
Message
From
01/07/2009 15:53:10
 
 
To
01/07/2009 14:31:15
General information
Forum:
Visual FoxPro
Category:
Visual FoxExpress
Miscellaneous
Thread ID:
01409629
Message ID:
01409651
Views:
36
>I have an Agencies - Departments - Functions arrangement where each has an ID. I'd like to auto-generate ID numbers for each and be able to regenerate the same numbers for each new entity. For example: Agency ID 1, Agency ID 2, ...Agency ID n. Then for each agency's departments, Dept ID 1, Dept ID 2, ...Dept ID n. And similarly for Functions so that given different agencies I'd have:
>Agency ID 1 - Dept ID 1 - Function ID 1;
>Agency ID 1 - Dept ID 1 - Function ID 2;
>Agency ID 1 - Dept ID 2 - Function ID 1;
>Agency ID 2 - Dept ID 1 - Function ID 1, and so on.
>
>I'd appreciate some ideas on how to go about doing so. I'm currently using Visual FoxExpress. It provide a VFENewKey function that autogenerates values but does not regenerate them as above.

What the point of that? IDs are supposed to be meaningless. It is just a key to link relational tables. Also, departments belonging to different agencies are supposed to have different IDs. It seems that you want to have separate sequential fields like AgencyNo, DeptNo, FuncNo in addition to IDs.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform