Quantcast
Channel: Adobe Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 238792

Help with updating databse with cfloop

$
0
0

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?


Viewing all articles
Browse latest Browse all 238792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>