homosapien.tv Posted April 4, 2002 Posted April 4, 2002 Hello I'm new and I'm struggling with the concept of primary keys. I've got four files for a farm. Planting details which times the planting of crops, and works out how many seeds are needed to be planted based on a grower's order. (Has variety, grower's name, planting date, picking date) Plant growth which just has the different growth rates of a variety given the time of year planted. (Has variety, january, february...december) Seed bank which maintains a running balance of different varietal seeds in stock. (has variety, date in, date out, then calculation fields) Growers which is a contact database of clients. (growers name, address, telephone) The first three files all have defined relationships based on variety. The contact database I'll link to Planting details with Grower name so I can work out who the seeds are getting grown for. I haven't set up any specific auto-entry fields as primary keys but notice that filemaker has indexed the variety field automatically in the first three files (I suppose based on the relationship). Is this fine? Is there a specific reason for setting up an automatic numbering system for each record in a file? I'm wanting to work this out now so that I have no nasty surprises later on when the fields are populated with data. Thanks everyone Drew PS. I suppose indexing the contact file with an automatic number would help with that file in case two grower's had the same name. Is this correct?
Fitch Posted April 5, 2002 Posted April 5, 2002 It's generally considered asking for trouble to use names of any kind as primary keys. Like you said, "...in case two growers had the same name." Yikes! Also, what if a person or plant's name needs to change? A big mess if you're relying on that as a key field. Much safer to go with some sort of number or alphanumeric code that is used ONLY for database housekeeping.
Kurt Knippel Posted April 5, 2002 Posted April 5, 2002 See my article in another forum for more information on this... http://www.fmforums.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=8;t=000018;p=
homosapien.tv Posted April 6, 2002 Author Posted April 6, 2002 Thanks to both of you for your help.....much appreciated....drew
Recommended Posts
This topic is 8323 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now