Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code takes too long to run
Message
De
09/08/2006 16:56:06
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01144231
Message ID:
01144311
Vues:
12
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform