Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert - SQL slower in VFP9 than in VFP6???
Message
 
 
To
23/02/2007 16:47:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01198068
Message ID:
01198465
Views:
14
Rick,

Here's the other Rick's <g> point:

m.lcOutfile = "testOut"
INSERT INTO (m.lcOutfile) FROM memvar

But the table is opened with the alias MyOut. So, if you change your insert to
insert into MyOut from memvar you would gain your speed back.

Not to mention Cetin's idea of changing this piece to
select MyIn
scan
  ...
  insert into MyOut from memvar
endscan
No need for locate, select MyIn before endscan, skip.

>>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)..
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform