You have a dynamically named column that you can't use with the function
ValueList(). This leaves two options:
Option 1 (use an alias to get a fixed column name):
<cfquery datasource="#dsn#" name="qGetFilenames">
SELECT #imageColumnName# AS mycol FROM products
UNION
SELECT #imageColumnName# AS mycol FROM dolls
</cfquery>
<cfset fileNames = ValueList(qGetFilenames.mycol)>
Option 2 (use evaluate):
<cfquery datasource="#dsn#" name="qGetFilenames">
SELECT #imageColumnName# FROM products
UNION
SELECT #imageColumnName# FROM dolls
</cfquery>
<cfset fileNames =
Evaluate("ValueList(qGetFilenames.#imageColumnName#")>
Evaluate is not a very performant function and should only be used if
there is no other option (and there usually is another option)
Pascal
> -----Original Message-----
> From: Donna French [mailto:[EMAIL PROTECTED]
> Sent: 17 November 2004 20:15
> To: CF-Talk
> Subject: Re: Help! Error on ValueList SOLVED
>
> Thanks for your help Pascal. Forgive me for not knowing, but can I ask
> you why I should use the alias instead of the variable ?
>
> TIA,
> Donna
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184647
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54