Posted by Tom Fulton on October 24, 2005 at 06:08:37:
In Reply to: Sub Keys are NOT unique posted by Jim Guerber on October 23, 2005 at 09:36:54:
Thanks for the response and the example, Jim. Just to expand on this a little bit:
If I have a keyed Customer file with 20,000 records in it and a sub-key on Sort Name, the sub-key file itself will have 20,000 records in it, yes? I know that the sub-keys are not unique in that there are many sort names that may be "Jones". But there has to be something "behind the scene" that is making the key unique - giving it the ability to point to one and only one key/record in the primary file. Speaking only for myself, I have no keyed files with keys longer than maybe 50 bytes.
I can also think of a number of places where accessing my file via a sub-key, SQL Querying as it were, I would want my results table delivered in primary key sequence. For example, the colors in my pattern file as outlined below, or all order detail lines for a specific item you'd want to come out in order number order. Would it be possible to optionally create the sub-key file with the ability to have its "sort order" within the sub-key be in primary key order? It could exception branch if the sum of primary key length plus sub-key length was greater than the maximum key length. Tom.