I am trying to do a partial Update to a sql database but I am not sure of the
best way to go about it. I have a database with 7 ID's in it. I want to take
another database of 10000 records and update them so that the 7 ID's are
distributed evenly (or as close to even as possible).
I used a <cfset avail_num = #round(member_records.recordCount /
avail_ids.recordCount)#> to get the number records in each set (which I will
just post the remainder to the last ID). I am not sure however to tell cold
fusion when updating a record to only update the first x (avail_num) records
with the first ID and then move on to the next set of x and update them with
the next ID and so on. My code looks liks this so far:
<cfset avail_num = #round(member_records.recordCount / avail_ids.recordCount)#>
<cfoutput query="avail_ids">
<cfquery name="update_records" datasource="test_data" maxRows = "#avail_num#">
update
test_users
set
ID = "#avail_ids.tech_number#"
where
ID = ""
</cfquery>
</cfoutput>
Any suggestions on how I can get this to work?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how to get a fax number that sends and receives faxes using your
current email address
http://www.houseoffusion.com/banners/view.cfm?bannerid=64
Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2128
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54