You say you're trying to update multiple rows... but your WHERE is stating,
"WHERE project_id = #URL.projectID#".

Since URL.projectID most likely isn't changing during the iteration of that
loop, you'll only ever be updating one row 'x' number of times.


On Tue, Nov 2, 2010 at 4:28 PM, Rick Colman <rcol...@cox.net> wrote:

>
> I am trying to update multiple rows by looping through:
>
> <cfloop query="GetExpOrg">
>
>     (diagnostics) <cfoutput>row: #GetExpOrg.currentrow# id:
> #GetExpOrg.ExpOrg_ID#</cfoutput><br>
>
> <cfquery datasource="#application.datasource#" name="UpdateExpOrg">
>         update Project_ExpOrg
>             set OrgValue=(select org_value from expressionorganism3
> where exporg_id = #GetExpOrg.ExpOrg_ID#)
>             where project_id = #url.ProjectId#
> </cfquery>
>
> </cfloop>
>
> my diagnostics give me:
>
> row: 1 id: 2
> row: 2 id: 693
> so that is ok.
>
> but both rows are updated with the last value (693) instead of being
> individually updated?
>
> What's wrong with this?
>
> TNX if you can help.
>
> Rick.
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338777
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to