Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimizing replace
Message
From
02/12/2000 04:45:57
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/12/2000 14:14:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00448237
Message ID:
00448472
Views:
8
>Hi all-
>
>I am importing the results of a regression run to an existing fox table, using odbc. After I get an import cursor for use in VFP, I scan it and replace each field in the target table as I find the record, like so:
>
>SCAN
> IF INDEXSEEK(EVAL(lcSeekExpr),.T.,lcTargetTable,.cPKIndex)
> REPLACE (lcTargetField) WITH EVAL(.cSourceField)
> ENDIF
>ENDSCAN
>(the import cursor always includes the fields for the pk of the target table.)
>
>This takes about 13 minutes for 18,000 records on my local machine. I'm wondering if I should do an SQL select and join the two tables, and then overwrite the target table with the output cursor. This might speed it up, but I'm not sure of the other implications for the data - for instance the target table could be involved in several relations. Any ideas for optimizing this would be much appreciated-
>
>TIA-
>Carlie

Carlie,
If this is really all the code within that scan...endscan I'm afraid you're doing the same operation 18000 times. Providing more of the code would help better.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform