Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimize Program
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00657743
Message ID:
00657823
Views:
27
>Hi,
>
>I have this program to split the address field. The program scans
>a table record by record and updates certain fields. What it
>really does is, it splits the value in address field into four values
>namely StreetNo, StreetName, Predirectional, SecondaryAddr. It then
>inserts these values into the corresponding fields for each record.
>I am not altering the structure of the table. I already have the
>extra fields (streetname, streetno etc.) but only that these fields
>are empty and they are updated by this program.
>
>The table has over 2 million records and I want to make sure that this
>job is done in the shortest time possible. Could anyone suggest the
>things that I should take care of.
>
< snip >

There's not much you can optimize in this code because every record has to be processed. The speed of standardize() program would have major impact on the overall speed. It's not clear how that program returns values into stname, stno, predir and secadr variables.
SELECT mytable
IF RECCOUNT() > 0
	SCAN
		standardize(mytable.address)
		REPLACE streetname WITH stname, ;
                        streetno WITH stno, ;
                        predirectional WITH predir, ;
                        secondaryaddr WITH secadr
	ENDSCAN
ENDIF
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform