Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code takes too long to run
Message
From
09/08/2006 16:56:06
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01144231
Message ID:
01144311
Views:
18
>Here is the code to open Network table:
>use (m.tcFileName) in 0 alias curProcess exclusive
>lcFileName = juststem(m.tcFileName)
>
>alter table dbf('curProcess') ;
>add column cStatus C(10) ;
>add column stat_date D NULL ;
>add column reso_date D null ;
>add column cDescr C(50)
>And then I'm scanning this table and change data in every record. Do you think I should use it in shared mode and buffered once I've changed the structure? Or should I create a cursor instead? The end result should be XLS, but it would be nice to keep a table too.
>
>I'm thinking I can do all the processing using a cursor instead and at the end just update the table...
>
>Just wondering if it's worth to change the code this way.

Not sure I understand why you are changing the table structure. Is this being done each time and then a throw-away? Why not just define the table initially with the additional columns? Is this by user? If by user, you may want to have a local table with the same key as the curProcess table and then do a JOIN? If you can do this, I have found that an INSERT INTO is much faster than REPLACE .. WITH (particularly over a network). You could even have the second table on the network and still do an INSERT INTO and then a JOIN for report.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform