Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compare 2 large .dbf'

Status
Not open for further replies.

friend01

Programmer
Jun 4, 2009
94
CA
Hi,

I'm looking at thread184-1549192. as I would need to compare 2 .dbf's. There are 19 fields in each dbf with the exact same structure in both dbf's. For some reason I can't create an index on all field1+field2+etc upto field19 so that I can get my 'unique key'. any suggestions on how I can go about this?

thanks in advance.
F1
 
indexes are limited to a legnth maximum of 240 Bytes. Try to compare checksums instead, see SYS(2017). Or index on left(field,x). You may also not need every field in the index. If there is any field combination that would define a unique record it will suffice to index on that field group.

Bye, Olaf.
 
To continue with Olaf's suggestion, if you define an index on one or more fields which would be unique for each record you can use it.

SELECT Tbl2
SET ORDER TO UniqRec

SELECT Tbl1
SET RELATION TO Field1 + Field2 INTO Tbl2
SCAN FOR Field1 # Tbl2.Field1;
OR Field2 # Tbl2.Field2;
OR Field3 # Tbl2.Field3;
< and so-on and so-on as necessary. >
< do whatever >
ENDSCAN

Good Luck,
JRB-Bldr
 
For large strings, I use VFPENCRYPTION.FLL from Sweet Potato Software to create an SHA_512 hash of the fields, save that to a C(64) field, and use that as the index.

Set library to VFPENCRYPTION.FLL additive
replace hashfld with Hash(fld1+fld2+fld3+fld4+fld5+fld6+fld7+fld8+fld9+fld10+fld11+fld12+fld13+fld14+fld15+fld16+fld17+fld18+fld19) all
 
Hi All,

I used the "compare checksums - SYS(2017)". Worked as needed.


Thanks All,
F1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top