Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement