Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to update a table from a cursor.
Message
From
28/03/2008 03:30:33
 
 
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:
01306380
Views:
6
In your sample you don't have any reference to the from table. You must add soemthing like "where exaMtraN.fieldx=mountt.fieldy"

>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
>	
>	
>	
>	UPDATE exAMtraN SET obt01 = cw,  obt02 = hw, obt03 = calli, obt04 = clean;
>             WHERE yeaR = KPSYEAR AND examtran.examcode="Annual 07-08" from moontt
Previous
Reply
Map
View

Click here to load this message in the networking platform