ok to use a cffunction to output a query ?
Is it ok to pass a parameter to a cffunction, perform a select query, then finally output the result ?
Can someone show me how to call the function and output the result of the query ?
<cffunction name="func_getCats" returntype="query">
<cfargument name="department">
<cfset var getCat=""/>
<cfquery name="getCat" datasource=#APPLICATION.datasource#>
SELECT category
FROM test
WHERE department = #arguments.department#
</cfquery>
<cfreturn getCat/>
</cffunction>
