Thanks for the reply Chuck, Yes I have an ID column which is the primary key.
How would I approach it then ? thanks aor >You are setting the column Shirt in the table Team for all records. > >You need a where clause to update the individual records. > >Do you have a primary key set, like an id column or something. > > >Chuck Weidler >Lockheed Martin Information Technology >7152 Windsor Blvd >Baltimore, MD 21244 >Voice: (443) 348-4252 >Email: [EMAIL PROTECTED] > >Hi, > >This seems like it should be pretty straightforward but I'm new to >ColdFusion and cannot get this at all. > >I want to update a column in a database with an incremented variable in >a loop. I want to be able to do this for a date column eventually >(increment to next >day) but >I cannot get even this basic query below to work. > >The query is : > ><cfset playerShirt = 1> > ><cfloop condition = "playerShirt LTE 10"> > <cfquery name = "UpdateTeam" datasource = "#dsn#"> > Update Team > set Shirt = #playerShirt# > <cfset playerShirt = playerShirt + 1> > </cfquery> ></cfloop> > >What I want this to do is loop through the Team table starting at row 1 >and update the players shirt number from 1 to 10. > >At the moment all shirt numbers are set to 10. > >Any guidance on this would be greatly appreciated. > >thanks in advance > >aor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3508 Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
