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:323359
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4