Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem in the scan loop code
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Problem in the scan loop code
Miscellaneous
Thread ID:
00649804
Message ID:
00649804
Views:
37
Hi everybody,

Once in a 4 months we receive lots of zipped files with all streets in US with their zipcode, lan, lot, etc., so we recreate our Streets table.

I zap it at the begining of the code and then I ran a loop for all zip files, extract them and process then by scan.

I don't want to insert complete duplicates in the Streets table, so here is the code, I use:
if not seek(m.State+m.City+m.lcStreet+m.OddEven+bintoc(m.lnLow),'Streets','CityStreet') or ;
	Streets.high<>m.lnHigh or Streets.UnitLow<>m.UnitLow or ;
	Streets.UnitHigh<>m.UnitHigh
insert into Streets (low, high, OddEven, STREET, zip_code, zip4, ;
			carrier_rt, ccode, town, State, City, ;
			cnsstract, cnssBlgr, lat, lon, UnitLow, UnitHigh) ;
values (m.lnLow, m.lnHigh, m.OddEven, m.lcStreet, m.zip, m.zip4, ;
	m.crrt, m.ccode, m.town, m.State, m.City, ;
	chrtran(substr(m.block,6,7),".",""), ;
	substr(m.block,13,1), m.lat, m.lon, m.UnitLow, m.UnitHigh)
endif
Do you see problems in it? I just ran my update code and it produced 1,6MM records. Originally I ran the code without check, and then select distinct and append, but these two processes took very long time, so I decided to do a check while processing... I believe, in my first tests I got around 1,45MM records, so may be this code is wrong. Could you please help me to understand, what's wrong with it?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform