What I believe happens is that two different statements will be compiled in
the database, one that has two bind variables and one that has one. So you
should get the same speed benefit, the database just treats them as two
different statements.

On 10/24/07, Ben Mueller <[EMAIL PROTECTED]> wrote:
>
> Posted this yesterday, but it didn't seem to go through...
>
> I became a convert to cfqueryparam, thanks to this list, about 2 months
> ago.  Since then, I've wondered about this kind of statement (shortened
> here):
>
> <cfquery>
>
> SELECT username
>   FROM user
> WHERE lastname = <cfqueryparam type="varchar" value="#mylastname#">
> <cfif len(myfirstname)>
>   AND <cfqueryparam type="varchar" value="#myfirstname#">
> </cfif>
>
> </cfquery>
>
> Does the presence of the <cfif> block inside the SQL negate the speed
> benefits I would get from using cfqueryparam?  I'm kind of hoping not, but
> guessing yes.
>
> Thanks in advance for the advice,
> Ben Mueller
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291975
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to