Update with CFLoop
People,
I need to update a field with a sequence number (1,2,3,4,5...) but, my code is updating all rows only with the last value... (10).
See the code below;
<!---<cfquery name="q" datasource="x">
select *
from table1
where id=#attributes.id#
order by data_vencimento
</cfquery>
<cfloop query ="q">
<cfset idx = 0>
<cfloop index="idx" from="1" to="#q.recordcount#">
<cfset idx = idx+1>
<cfquery name="q2" datasource="x">
UPDATE table1
SET column=<cfqueryparam value="#idx#" cfsqltype="cf_sql_integer">
where id=#attributes.id#
</cfquery>
</cfloop>--->
What's wrong here?
Tks!
