Skip to main content
Inspiring
September 10, 2007
Question

Cfquery - Use cfqueryparam and cachewithin on same query

  • September 10, 2007
  • 2 replies
  • 413 views
Question:
How can we use cachedwithin and cfqueryparam together in the same query? When I run the following code, It states that the two cannot be used together:

<cfquery name="get_something" datasource="#application.datasource#" cachedwithin="#CreateTimeSpan(1,0,0,0)#">
SELECT * from tablename
WHERE id = (<cfqueryparam value=#someid# cfsqltype="cf_sql_bigint">)
</cfquery>

I would like to be able to cache the query and also validate the value being passed to it.


Any ideas on how to pull it off?
    This topic has been closed for replies.

    2 replies

    Inspiring
    September 10, 2007
    If you are not using cf8, validate the variable before the cfquery tag. In fact, if you are using cf8, validate the variable before the cfquery tag.
    Inspiring
    September 10, 2007
    upgrade to cf8. prior to cf8 it was not possible.

    --

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com