I have an odd problem – I'm trying to accomplish something in CF which requires me to loop through a list of values, performing a query for each iteration and using the passed value as part of the query name. I know there are various reasons why this isn't considered a good idea, performance-wise, but I have an odd set of circumstances.
These dynamically named queries return a single column of data, which I need to place into a list, which again would be dynamically named, using the passed value as part of the name.
The problem is that the ValueList() function doesn't accept dynamically generated parameters: Dan Switzer blogged about this problem last year.
I have a dim memory of hitting this problem before – a quick grep through my old code library leads me to believe it was early 1999 when I ended up using a complex series of cfloops & cfsets to achieve what I needed.
I find it difficult to understand why this seemingly glaring omission still hasn't been corrected after all these years.
Leave a Reply