Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimize Program
Message
From
17/05/2002 07:57:08
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00658071
Message ID:
00658077
Views:
11
Hi Ria

If you can afford to remove the indices before running the process, it would help. However, one often needs indices to check for duplicates.

You can issue a single replace command for a set of fields. There should be little difference.

REPLACE FIELD1 WITH EXPR1, FIELD2 WITH EXPR2



>Hi,
>I had posted the message below yesterday and I thank all of you for your valuable suggestions.
>
>I have some more questions on this.
>
>- MYTABLE has indices defined on the fields. When the REPLACE coomand is issued, will my indices be updated immediately? If this is the case, would it be a better choice to delete all indices when starting the program and after all the fields have their new values, have the program to recreate the indices?
>
>- Will succsessive 'REPLACE' slow down my program. Would it be better to use the UPDATE SQL query instead?
>
>Please give your comments.
>
>Thanks a bunch.
>
>Ria
>
><<
>
>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.
>
>Here is a snippet of the code:
>
>SELECT MYTABLE
>IF RECCOUNT() > 0
>SCAN
>ADDRESSVALUE=MYTABLE.ADDRESS
>STANDARDIZE(ADDRESSVALUE)
>REPLACE STREETNAME WITH STNAME, STREETNO WITH STNO, PREDIRECTIONAL WITH PREDIR, SECONDARYADDR WITH SECADR
>ENDSCAN
>ENDIF
>
>STANDARDIZE IS A PROGRAM THAT SPLITS THE ADDRESS FIELD INTO
>THE VARIABLES STNAME,STNO,PREDIR,SECADR.
>
>
>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform