Using cachedWithin/cachedAfter in CFQUERY with CFQUERYPARAM

  Jun 30, 2008     8737 Views      ColdFusion       Comments (0)   

Earlier morning, I was working on creating a cached query for to display Next N record-navigation interface. I'm having the ColdFusion 8 installed in my system. The below query with CFQUERYPARAM executes well and my aim of displaying Next N record-navigation is achieved.

<cfquery name="qBlogFeedResult" datasource="#application.dsn#" cachedwithin="#createTimeSpan( 0,0,30,0 )#">
select *
from blogfeed
where datecreated > <cfqueryparam value="#attributes.date#" cfsqltype="cf_sql_timestamp">
order by datecreated desc
</cfquery>

When testing this query in my other system having ColdFusion 7 installed I got the below error because CF 7 will not allow of using cfqueryparam in cfquery with cachedWithin/cachedAfter.

Using "cachedWithin" or "cachedAfter" in CFQUERY with CFQUERYPARAM is not allowed.

The great news is ColdFusion 8 allows cachedWithin/cachedAfter in cfquery with cfqueryparam and this is one of the hidden gems of ColdFusion 8. But in CF8 documentation which is not having the updated information about this functionality.

To explore more about CF 8 Hidden Gems please check Charlie Arehart's presentation on Hidden Gems in ColdFusion 8 PDF and his recorded Adobe Connect Presentation.

About Me

CFML/Web/Salesforce/Agile Enthusiast, Husband & Dad, an avid learner & android fan. Creator of GetCFMLJobs.com who works as a Tech Consultant in Toronto, Canada.

GetCFMLJobs.com!
Get Your Next CFML Job!
ColdFusion Tuts
ColdFusion Tutorials & Resources


Categories

Adobe Agile AppCore Creator BlogCFC Books Bootstrap CFBuilder CFEclipse CFML Chennai CFUG Chrome Extensions ColdFusion Google IIS India Learning MySQL Railo Subversion Tools & Utilities Web Windows 7


Archives

2018 2017 2016 2014 2013 2012 2011 2010 2009 2008

Search


Akbarsait © 2008 - 2019 | Hosting provided by Vivio Technologies

Home | Blog | Sitemap | RSS Feed