Whatever message this page gives is out now! Go check it out!

RemoveCachedQuery

Last update:
May 18, 2026

Description

Removes the query with the details you provide from query cache.

Returns

Nothing

Syntax

removeCachedQuery(sql, datasource, params, region)

History

ColdFusion (2018 release): Introduced named parameters.
ColdFusion 10: Added this function.

Properties

Parameter
Description
sql
The query SQL.
datasource
The datasource you ran the query on.
params
(Optional) Array of parameter values passed to SQL.
region
(Optional) Specifies the cache region where you can place the cache object

Example

<cfset sql = "SELECT * from art where artid = ?"> 
<cfquery name="q" datasource="cfartgallery" cachedwithin="#CreateTimeSpan(0, 6, 0, 0)#"> 
SELECT * from art where artid = <cfqueryPARAM value = "1" CFSQLType = 'CF_SQL_INTEGER'> 
</cfquery> 
<cfset a = arrayNew(1)> 
<cfset a[1] = 1> 
<cfset removeCachedQuery(sql,"cfartgallery", a)>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page