Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extremely odd 'append from' situation
Message
De
15/06/2006 15:54:38
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Divers
Thread ID:
01128466
Message ID:
01129384
Vues:
19
I don't think I can. It would only make sense if I gave you the particular files that I'm using and they contain proprietory client information.

The code really was almost as simple as I originally posted though. I simply create two free tables, create two indices on the first one and then append a text file containing about 5,100 records. Then I index the 2nd one and append another text file with about 40,000 records. Both text files are fixed width fields delimited with "|". I know, but that's the way it's been forever.

I've discovered a bit more going on though. When I create the tables, I set safety off and overwrite the ones that are sitting there from the previous week's run. Then I set safety back on. So the new tables are empty when I do the import. I've stepped to make sure. For whatever reason, I found that the number of records being imported into the new empty tables is the same as the number that were in the previous overwritten tables - even though the new text files contain more records. I discovered that sometimes this will happen regardless whether I create the indices before or after the append. It also didn't happen every time.

I don't understand it. What I finally did was to actually erase the previous tables before creating them anew. Now it works properly.

I also want to point out that I haven't seen this behavour anywhere else but in this particular program, so whatever is going on may be because of something else in the program, but I honestly can't imagine what. This process is in two methods. One (MakeTempTables) does nothing else but create the tables (it used to also index them), the other (GetImportData) does nothing else but append and index (It didn't used to index). I can't see why some other part of the code should be an issue. The calling code is also simple. Not much more to calling the methods than:
IF oImp.MakeTempTables()
   IF oImp.GetImportData()
      oImp.DoImport()
   ENDIF
ENDIF
>Could you provide the working example to reproduce the behavior?
>
>>Yes, it came up a while back and I was surprised at the time to learn that. I didn't go back and fix the code in this application since, at the time, it wasn't broken. Now it is and I don't know why.
>>
>>The question still exists though - why should the append only append a portion of the text file if the index already exists, and the whole text file if the index is created afterward.
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform