Skip to main content
Participating Frequently
July 22, 2008
Question

Row Iterator

  • July 22, 2008
  • 2 replies
  • 722 views
Hi all,

I am trying to update a table by going through each record and updating it with the appropriate value however loops are not working. I did some research and I guess I need a row iterator of some kind. Any ideas on how to do this in coldfusion?

Thanks
This topic has been closed for replies.

2 replies

Participating Frequently
July 23, 2008
An example of what you have tried, and perhaps a more detailed description of what you are actually trying to do, might help.

Phil
Tams87Author
Participating Frequently
July 23, 2008
Ok so the first query gets a list of location ids and no of placements by comparing location ids with firstchoice location ids from another table.

The second query is supposed to randomly select firstchoice location ids based on those ids matching the location table's ids and depending on the number of placements each location has, selecting that many firstchoice locations ids. This is where I am having problems since the code I have gets only the placement for the first placement and ignores all others.

The code is attached.

Thank you in advance.
Participating Frequently
July 22, 2008
What kind of "table" are you referring to? Database? HTML?

Phil
Tams87Author
Participating Frequently
July 22, 2008
Umm, sorry I should have mentioned that. It is an oracle database table.
July 22, 2008
You should first to a SELECT query to obtain the unique ID of the rows you want to update. Then do a simple CFLOOP over the query to update the records. See concept code below.