The CFIF will result in two different SQL statements to be prepared, instead of one, so there is a slight ramification. Pretty irrelevant though.
cheers, barneyb On 10/23/07, Ben Mueller <[EMAIL PROTECTED]> wrote: > Hi all, > > I've become a convert to cfqueryparam after posting a question about it to > this group several months back. Since then, I've started wondering about the > benefits of it if there are <cfif> statements in a <cfquery> block. For > example: > > <cfquery name="myname" datasource="myDB"> > > SELECT email > FROM user u > WHERE country = <cfqueryparam cfsqltype="cf_sql_varchar" value=#somecountry#> > <cfif len(somestate)> > AND state = <cfqueryparam cfsqltype="cf_sql_varchar" value=#somestate#> > </cfif> > </cfquery> > > Does the presence of the <cfif> statement inside the cfquery block negate all > the performance benefits I would have otherwise gained from using > <cfqueryparam>? If so, I would guess this is a common issue people run into. > Is there a best practice for handling this kind of situation? > > Thanks in advance, > Ben Mueller -- Barney Boisvert [EMAIL PROTECTED] http://www.barneyb.com/ Got Gmail? I have 100 invites. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291890 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

