Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert - SQL slower in VFP9 than in VFP6???
Message
From
22/02/2007 17:30:26
 
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:
01198144
Views:
23
>Could you please post a complete reproducible scenario (with table structures)?

Thanks Naomi, this helped me track down my problem. I created a small .prg that is essentially doing what I was doing in the main data import and found that if I had the table opened, the insert was very slow in VFP9, but not ran fine in VFP6. Does anyone out there know why?

The code to recreate is below. I normally wouldn't have the destination table opened if I was doing the SQL - insert, but I had modified someone else's code, who was previously using the append blank, gather method, and therefore had opened the destination table. When I changed the code to an insert, I didn't comment the line of code to open it. Anyone know why this is a problem? I looked in the hackers guide but didn't find anything.

-Rick
lcInFile = "testout"
lcOutfile = "testin"

USE testin IN 0 ALIAS MyIn

* IF the next line is executed in VFP9, each insert runs very slow
*USE testout IN 0 ALIAS MyOUT
*

lnTotal = 0
SELECT MyIn
locate

DO WHILE !EOF()
	SCATTER MEMVAR
	INSERT INTO (lcInfile) FROM memvar 
* The next 3 lines of code run very fast regardless of version of VFP
*		SELECT myOut
*		APPEND BLANK
*		GATHER MEMVAR
	Sele MyIn
	SKIP
ENDDO
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform