Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SEEK or LOCATE?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00253099
Message ID:
00254712
Views:
28
>Now, my question then becomes, is it more advisable to use character fields for the primary key with compound indexes and seek to find specific records, or are you better to use integer fields with individual indexes combinded with a 'LOCATE FOR this = that AND here = there'?

Justin, you should stay with your integer keys. The simple answer to the problem of locating one child of a parent invoice is to use LOCATE (with RUSHMORE). It's still very fast though slower than SEEK.

I try to avoid compound keys if at all possible. In fact I think I eliminated the last one that I was using and replaced it with a complex integer key. (I create an integer that combines the factors I need and store it in the record.) I used to have trouble with that index and now I dont.

The longer answer is that you would probably use an SQL select to get all of the line items for a given invoice. I have an open item billing system and when the user goes to the ledger entry form I get all of the open items and populate a view that the operator can see. I can't think of a situation in which I would search for one open item only.

Let me know if I'm not answering your question and I'll try again.

Peter
Peter Robinson ** Rodes Design ** Virginia
Previous
Reply
Map
View

Click here to load this message in the networking platform