Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique ID's in inventory systems
Message
From
19/05/1999 16:36:17
 
 
To
18/05/1999 17:45:15
Jorge Haro
Independent Consultant
Juarez, Mexico
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00220153
Message ID:
00220614
Views:
23
>Thank you all for your answers, I do use a key generating function, basically for every table, the key is a character string, I think it's easier to manipulate them in relations and that sort of thing.
>
>I also use table buffering and an error handler to take care of conflicts, the key generation part has worked well so far.
>
>**** Actual question here
>
>Basically I was trying to decide if I should stick to this double Id thing, mine and the user's, or should I go with the user's input, and validate it on creation, then use RI rules to handle changes.
>
>
>So far I've stayed away from RI rules, when I began programming in VFP I thought it could really slow things down if you change a part number, to go and update possibly thousands of records that contain the old value, I hadn't tried it though. The unique Id allows me to stay clear of this.
>
>My key generation program is also called newid(), a friend pased it to me, and I know he got it from someone else :), I've made some changes to it, among them, I took it out of the DBC procedures into it's own prg.
>
>Apparently the system assigned unique ID thing is the way to go.
>
>Thanx

Oh, slightly different question. In terms of carrying two id's ... If the customer wants it you pretty much need to do it. (Okay, if they really want a framitz, build them a framitz).

We have to deal with a mainframe in the mix of things here. Their data structures are a bit difficult to work with, and for some reason they really want business meaning in things like purchase order numbers. Any way, because the po# is one hard to construct, and two has a tendency to loop around generating repeating po#'s, we carry an integer primary key, and build their po#. When we run out of po#'s during the course of the day, we start replacing them with (*'s). Lately every time someone wants to know what a po# is they look for the primary key ... Change is possible, sometimes it's just harder than others. (But I digress)

As for using a character instead of an integer, you can do that, but there are a couple of reasons for using integers. One, they take up much less space in terms of bytes than characters. Two, they are much easier to increment.

Good luck,

Regards,

Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform