recompiled every time? This seems to be a bit counter intuitive to me,
but it is basically what I'm trying to confirm.
In the most ineloquent and non-technical way (and with respect to Oracle
who supports the bind vars)....
If you use the cfqueryparam round the static var... then it will treat
that bit of SQL as dynamic and will recompile every time....
If you don't put it in a cfqueryparam then it will tell the dbengine
that that bit of SQL is not going to change... dont bother trying to
treat it dynamically.... resources freed
I asked this question and quite a discussion broke out between the DB
heavyweights (Jochem and Adam I think)
I've tried my best to find it in the archives but I can't for some
reason.....
The rule I got from listening to others was to *only* use cfqueryparam
for dynamic vars in the SQL (dates are an exception cos there a PITA
anyway) if they aint gonnae change, why put them in cfqueryparam?
http://www.macromedia.com/devnet/server_archive/articles/cfqueryparam_or
acle_databases.html#4
<snip>
CFQUERYPARAM
In the example query, ColdFusion Server will send the query to the
Oracle database as:
SELECT username FROM users WHERE user_id=:1
The ":1" is a substitution variable (parameter reference). The execution
path is the same whether the userID is 2236 or 39393. Because there's no
use in parsing it more than once, ColdFusion can use the cached query in
the cache and thus conserve server resources.
</snip>
ie what's the point in forcing this parse if it is not necessary
it's the DBEngine that caches the query... not CF
--
-dc [ cf5, ora8.1.7, iis5 ]
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

