Also, can you expand on what you mean by "...WAS WORKING before and now is not"? I am wondering if the query is really not updating... or if you're just looking at old results. So first thing, did you actually verify the values are still unchanged _after_ the UPDATE queries?
<cfloop query="MarginToAdjust">
....
<!--- run the update --->
<cfquery name="update" datasource="ComSched" result="result">
UPDATE AgentPayout
SET Bonus = #newbonus#
WHERE (PayoutID = #MarginToAdjust.PayoutID#)
</cfquery>
<!--- check the new values --->
<cfquery name="update" datasource="ComSched" result="afterUpdateResult"
SELECT Bonus
FROM AgentPayout
WHERE PayoutID = #MarginToAdjust.PayoutID#
</cfquery>
<cfdump var="#afterUpdateResult#">
</cfloop>
BTW - It's better NOT to run queries within a loop, if at all possible. If you really can't avoid it, at least use <cfqueryparam...> . That should help performance by using bind variables.
Main Topics
Browse All Topics





by: _agx_Posted on 2009-09-21 at 12:48:17ID: 25386818
The query seems very simple. So assuming they _were_ executed, if nothing is updated, that suggests the PayoutID's were not found.
I am assuming they were executed based on the dumps you posted.