Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to update a table from a cursor.
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01306379
Message ID:
01306401
Views:
5
>how to update a table from a cursor.
>I try but ony smae value updating in each record
>
>Select scode,Descr,lcode,Sec,code_a,name,weight,Examcode,;
>	(Cast(Sum(obt01) As I)) /Count(code_a)  As CW,;
>	(Cast(Sum(obt02) As I)) /Count(code_a)  As HW,;
>	(Cast(Sum(obt03) As I)) /Count(code_a)  As Calli,;
>	(Cast(Sum(obt04) As I)) /Count(code_a)  As Clean,;
>	(Cast(Sum(obt05) As I)) /Count(code_a)  As Presence;
>	WHERE year=kpsYEar AND nmonth<9;
>	FROM awardlist ;
>	GROUP By lcode,Sec,code_a;
>	order By lcode,sec ;
>	INTO table moontt
>	
Please see corrections. How your table and a cursor are related?
	
	
	UPDATE exAMtraN from exAmTraN 
inner join Moontt on ExamTran.PK =  Moontt.PK 
SET obt01 = Moontt.cw,  
obt02 = Moontt.hw, 
obt03 = Moontt.calli, obt04 = clean;
 WHERE ExamTran.year = Moontt.KPSYEAR 
AND examtran.examcode="Annual 07-08"
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