Hi guys,
I'm working on something where I need to pass in a dynamic column name to
the ValueList function. The problem is that it doesn't appear to support it
because this function looks like it is an exception to the way that CF
usually passes variables. I've tried the code below and many variations
involving the Evaluate function all to no avail. This is eventually going
to be parameterized and thrown into a CFC, which is why the need for the
dynamic values. I'm trying to avoid using a loop and any manner of
ListAppend or string catenation. Any thoughts?
<CFSCRIPT>
//These two values would be passed in to a CFC
qryData = QueryNew("my_column");
sColumnName = "my_column";
//Make some dummy data
QueryAddRow(qryData);
QuerySetCell(qryData, "my_column", "my_first_value");
QueryAddRow(qryData);
QuerySetCell(qryData, "my_column", "my_second_value");
//Won't work
lstData = ValueList("qryData.#sColumnName#");
//Won't work
lstData = ValueList(Evaluate("qryData.#sColumnName#"));
</CFSCRIPT>
Thanks in advance,
Roland Collins
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]