Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data search
Message
From
04/11/2005 06:19:02
 
 
To
04/11/2005 04:41:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01065359
Message ID:
01065371
Views:
16
Abhishek

First of all make sure both tables are indexed on the PostCode, and that this index is current, i.e. they're ordered by it.

Now I'm not sure you have this the right way round. Normally one goes through rec's in one table and looks up the detail, given by a key, in a look-up table. e.g. an entity record has a county key, pointing to the County table, to look up the county's details.

It's usual for look-up tables to have fewer recs than the main, e.g. thousands of customer recs will have the same county key.

Anyway, in your described scenario, something like:
Select LOOKUP
Scan
  lcPostCode = LOOKUP.POSTCODE
  If INDEXSEEK( lcpostCode, .F., "S1", "POSTCODE")    && If find this pc in Si
      INDEXSEEK( lcpostCode, .T., "S1", "POSTCODE")   && go to it
      Select S1
      Scan while S1.POSTCODE = lcPostCode 
*       Test for the address details matching
*       If find match
*           Pull record - copy to Xaction file, store ref to it or whatever.
*       EndIf
      EndScan
  EndIf
EndScan
HTH

Terry


>hi everybody,
>
>I have to make a program where i have to search data into a table using a lookup table. The situation is like this
>
>lookup table : 10000 records where there is field like postcode,address,name
>searched table(S1) : 1.5 million records contains postcode, address, name etc
>
>now using postcode from lookup table, i have to search it in S1. If found i have to compare address and if matched, i have to match the name. Once complete match is done, i have to pull that record out (which is easy. i hope!!).
>If anybody can suggest me an approach which is fastest and effective, i would be very grateful.
>
>Many, many thanks in advance
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform