It's just as we all suspected. You should indeed scope things like query variables, like this...

<cffunction name="myFunction"...>
����� <cfset var q = ""/>
����� <cfquery name="q">
����������� SELECT * FROM Users
����� </cfquery>
����� <cfreturn q/>
</cffunction>

... and the "cfquery" struct is stored in the variables scope, which is why this works:

<cffunction name="myFunction"...>
����� <cfset var q = ""/>
����� <cfquery name="q">
����������� SELECT * FROM Users
����� </cfquery>
����� <cfset reportExecutionTime()/>
����� <cfreturn q/>
</cffunction>

<cffunction name="reportExecutionTime">
����� <cflog text="#cfquery.executionTime#"/>
</cffunction>

There does not appear to be a way to scope the "cfquery" struct just to the myFunction function. Is this something people feel they need? I personally have never had an issue with behavior, but if others have, we can see about getting it changed.

Also, are there any other questions in this thread left unanswered?

Christian
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to