Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert - SQL slower in VFP9 than in VFP6???
Message
De
23/02/2007 16:47:40
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01198068
Message ID:
01198463
Vues:
15
>I guess we were just blind <g> Now this explains everything and the problem was created by itself because of this typo.

I'm still getting the same behavior. There were indeed typo's in my first snippet that I posted here (arggh. Sorry for the mixup, I'm multi-tasking here and I wasn't being very careful). My exact actual code that I've been using is giving me the same results if I open the table, or, if I include the alias.
m.lcInFile = "testIn"
m.lcOutfile = "testOut"

USE testin IN 0 ALIAS MyIn exclusive

* IF the next line is executed in VFP9, each insert runs very slowly
*USE testout IN 0 ALIAS MyOUT exclusive
* using an alias in VFP9 appears to cause the performance decrease
* removing the ALIAS MyOut or, not opening the table, fixes the problem.

SELECT MyIn
locate

DO WHILE !EOF()
	SCATTER MEMVAR
	INSERT INTO (m.lcOutfile) FROM memvar 
* The next 3 lines of code run very fast regardless of version of VFP
* but of course table must be opened above for it to work.
*		SELECT myOut
*		APPEND BLANK
*		GATHER MEMVAR
	Sele MyIn
	SKIP
ENDDO
>Glad that worked, but since you need the table opened with an alias and the
>insert into dbf('myout') didn't work, try changing the line at the top of
>your code:

Rick, regarding your suggestion here, changing the value of stored in 'm.lcOutfile' (which is the path & name of my destination table) would mean I would always have to have the same name, i.e. "c:\test\myOut". The reason I'm using a variable to store it is because the table names vary depending on which data I'm modifying & importing. And if this weren't the case, I wouldn't use a variable to store the name in the first place. I think I confused the issue here when I typed in my first example snippet here in the UT (I don't know why I didn't cut & paste)..
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform