Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data from VFP to SQL server using SQLEXEC--Loopy updates.
Message
From
09/02/2000 18:04:21
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Title:
Data from VFP to SQL server using SQLEXEC--Loopy updates.
Miscellaneous
Thread ID:
00329788
Message ID:
00329788
Views:
87
It seems we can't escape looping no matter what we do. Suppose I have a VFP table, (created by downloading from MSQL) and 300 of the records in this table have been changed by the user.

So far I see two choices:

1) create a temporary table on the SQL server. Use an SQLEXEC insert statement inside a loop to add all the changed records to the temp table from the VFP table, and then using a single update with subqueries to to update the real table.

2) Forget the "single update" which still depends on inserts within a loop, and instead use the loop to do 300 individual updates.

This is where my SQL newbies status gets me. I strongly suspect there is a way to do this in a single SQL statement which those with more experience will instantly see. If the table I was updating from was on the server end, "Update with subqueries" would easily take care of this. Because my changes are in a temporary table on the client end, I don't seem to be able to get around the need for a loop.

If instead of using SQLEXEC I had created a remote a view -- and then done a tableupdate(.t.) VFP would write an update command behind the scenes. Would this be a single update? or a series of updates inside a loop?

In short is there away around all this loopiness? Or is SQL inside a loop simply the price I pay for putting processing on the client end?

Thanks

Gar
Thanks

Gar W. Lipow
Next
Reply
Map
View

Click here to load this message in the networking platform