you need to properly call the function, and since you are NOT in
cfscript block, you need to use <cfset>:

<cfset somevar = getProduct(3)>


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/


On 10/06/2009 23:12, Don L wrote:
> Are we able to run a cffunction within a cf query output?  Please see below.
> Thanks.
> 
> Don
> Chunshen Li
> 
> <cfoutput query="myQuery">
> ...
>   <cfif conditionX eq 1>
>       <cffunction name="getProduct" access="public" output="no" 
> returnType="query">
>         <cfargument name="id" type="numeric" required="yes">
>                       <cfset var data = "">           
>           <cfquery name="data" datasource="myDSN">
>               SELECT pname 
>             FROM product
>             where id=#Arguments.id#
>           </cfquery>
>         <cfreturn data>                                       
>       </cffunction>
>   
>        #getProduct(3)# <!-- it fails, why? fyi, the datatype of id is int. -->
>  </cfif>
>  
> </cfoutput> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323360
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to