Your rantings about var scoping CFC function variables has really made me look closely to how I code. If I var scope the name of a query before querying a datasource, will that query object become local to the function as well?
Rant? Me? Ok - so maybe I go a bit off the deep end at times with var scoping. The main reason is that it makes stuff very hard to debug if something goes wrong. But to answer your question, yes, if you var scope the name of the query before you use it, it will keep the query local to the function. This is how I do it normally:
<cffunction name="foo" returnType='query" output="false" access="public">
<cfset var q = "">
<cfquery name="q" datasource="kingsweallare"> select name from goo </cfquery> <cfreturn q> </cffunction> </code>
Notice that I did not define q as a query. Since CF is typeless, this is perfectly fine.