> I would also take a semi-Fusebox approach to this and write 
> the query in its
> own page and just include that page as needed.  That way, you 
> only need to
> go to one place to change the query ;)


And if it's a query that is run often enough and almost never changes (ie
GetCountries), as well as putting it in it's own file, cache the pants off
it too.

<CFQUERY DATASOURCE="#request.DataSource#"
                       NAME="GetCountries"
                       CACHEDWITHIN="#CreateTimeSpan(1,0,0,0)#">
etc, etc
                       

BTW, Dave Watts (bows in an Easterly direction) said that CACHEDWITHIN
queries only use the cached recordset when the SQL statements are
*identical*; even a bit of whitespace in a different place is enough to make
ColdFusion hit the database again.

Therefore, if you CFINCLUDE the query in it's own file, you make sure that
there is only ever one version of that query; ergo, no problems.


-- 
Aidan Whitehall <[EMAIL PROTECTED]>
Netshopper UK Ltd
Advanced Web Solutions & Services

http://www.netshopperuk.com/
Telephone +44 (01744) 648650
Fax +44 (01744) 648651
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to