On Friday, May 30, 2003, at 08:00 US/Pacific, Tony Weeg wrote:
> what var scope should I use here in this instance....
>
> here is the cfif block to check for the existence of the needed
> parameter to make the query...
Is the code below inside the scope of another query/loop? If so,
perhaps routeName clashes with a column in the outer query.
> <cfif isDefined("ReportWriterOld.driverId") and
> isNumeric(ReportWriterOld.driverId)>
Stylistically I'd use structKeyExists(ReportWriterOld,"driverId") over
isDefined() but that's a minor issue :)
> <cfquery name="getRouteName" datasource="#myDS#" maxrows="1">
> select name, narcReady, toteReady, outpatientReady,
> lateBy
> from routes
> where beginTime <= #timeIdAdj# and (endTime >=
> #timeIdAdj# or endTime is null)
> and dId = #ReportWriterOld.DriverId#
> </cfquery>
>
> <cfset routeName = "#getRouteName.name#">
What if the query returns no records?
> <cfelse>
> <cfset routeName = "No driver Id (old)">
> </cfif>
> it's the spots where I set route name, that im wondering what scope to
> make them?
Difficult to answer that question without knowing how you are using it.
Would "variables" scope be enough?
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics.
http://www.fusionauthority.com/signup.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4