Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem in the scan loop code
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Problem in the scan loop code
Divers
Thread ID:
00649804
Message ID:
00649804
Vues:
38
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform