Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Causing Fatal Exception
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01062055
Message ID:
01062229
Views:
10
Sergey,

That may very well work and it is the exact query that our Database Architect suggested. But, before I saw either suggestion, I rewrote it this way:
*JCJB*	10/26/2005 - Iterate the Min/Max cursor.
SELECT c_MinMax
SCAN
	*JCJB*	10/26/2005 - Update the Min Values of the Unlocked Stores in this Group.
	IF c_MinMax.nMin > -1
		REPLACE c_Store.nMin WITH c_MinMax.nMin ;
				ALL FOR c_Store.cGroup = c_MinMax.cGroup ;
				AND !c_Store.lLock IN c_Store
	ENDIF

	*JCJB*	10/26/2005 - Update the Max Values of the Unlocked Stores in this Group.
	IF c_MinMax.nMax > -1
		REPLACE c_Store.nMax WITH c_MinMax.nMax ;
				ALL FOR c_Store.cGroup = c_MinMax.cGroup ;
				AND !c_Store.lLock IN c_Store
	ENDIF
ENDSCAN
Obviously, this way isn't as clean as a single UPDATE, but it is working ... and if ain't broke ...

Thanks,
Chad

>Chad,
>
>If they're SPT cursor than it's unlikely that indexes got corrupted. I would try to rewrite UPDATE statement this way
UPDATE c_Store SET ;
>		c_Store.nMin = c_MinMax.nMin ;
>	FROM c_Store ;
>		JOIN c_MinMax WITH (Buffering = .t.) ;
>			ON c_Store.cGroup = c_MinMax.cGroup ;
>	WHERE ;	
>		c_Store.lLock = .f. ;
>		AND c_MinMax.nMin > -1
>
>
>>
>>I guess that's technically possible, but it seems highly unlikely as c_Store and c_MinMax are both cursors created from SPT. But, there are indeed indexes placed on them after creation, so I'll look into that.
>>
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Reply
Map
View

Click here to load this message in the networking platform