I want to move data from one column to another. I thought I could just query points2 column then use a cfloop to update the data to points1 column. Finally null out points2 column.
Below is my code on the first 2 steps. Unfortunately, I get the following error:
Syntax error in UPDATE statement.
The error occurred in wwwroot\forms\changepoints.cfm Line 18
<cfquery name="getPoints" datasource="#dsn2#">
SELECT leaderID, points2
from leaderboard
</cfquery>
<cfloop query="getPoints" startrow=1 >
<CFQUERY NAME="DoUpdate" DATASOURCE="#dsn2#">
UPDATE leaderboard
SET points1=#getPoints.points2#
WHERE leaderID=#getPoints.leaderID# (line 18)
</CFQUERY>
</cfloop>
What am I doing wrong?