Sonny,

These "constants" are not constants to the SQL server. To the SQL server
these are still unbound variables... So yes, you need to use cfqueryparam if
you want to hit the cache pool and execution plan cache. Otherewise the
driver hands off the "prepare" operation to the SQL server - meaning no
cache hit is possible.  As a point of interest ... Why would you ask this
question? Why not just use cfqueryparam as a matter of standard practice for
all input variables?

-Mark 


Mark A. Kruger, CFG, MCSE
(402) 408-3733 ext 105
www.cfwebtools.com
www.coldfusionmuse.com
www.necfug.com

-----Original Message-----
From: Sonny Savage [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 14, 2008 9:36 AM
To: CF-Talk
Subject: cfqueryparam

As I understand it, cfqueryparam enhances performance by using bind
variables.  My question is whether it helps to use cfqueryparam for
constants in a query.

Example
SELECT * FROM myTable WHERE code = 'X'
-vs-
SELECT * FROM myTable WHERE code = <cfqueryparam value="X"
cfsqltype="cf_sql_char" maxlength="1">

--
Edward A Savage Jr - "Sonny"
Senior Software Engineer
Creditdiscovery, LLC
"I was gratified to be able to answer promptly. I said I don't know." ~ Mark
Twain




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301265
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