Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6039195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:20:00+00:00 2026-05-23T06:20:00+00:00

I am getting some strange behavior involving database queries that I have never seen

  • 0

I am getting some strange behavior involving database queries that I have never seen before and I’m hoping you can illuminate the issue.

I have a table of data called myTable with some columns; thus far everything involving it has been fine. Now, I’ve just added a column called subTitle; and II notice that the SELECT * Query that pulls in the data for a given record is not aware of that column (it says the returned query does not have a subTitle column), but if I explicitly name the column (select subTitle) it is. I thought perhaps that the Coldfusion server might be caching the query so I tried to work around with cachedwithin="#CreateTimeSpan(0, 0, 0, 0)#" but no dice.

Consider the below code:


<cfquery name="getSub" datasource="#Application.datasourceName#">
     SELECT   subTitle 
     FROM     myTable
     WHERE    RecordID = '674'
 </cfquery> 

 <cfoutput>#getSub.subTitle#</cfoutput>

 <cfquery name="getInfo" datasource="#Application.datasourceName#">
     SELECT   * 
     FROM     myTable
     WHERE    RecordID = '674'
 </cfquery>  

 <cfoutput>#getInfo.subTitle#</cfoutput>

Keeping in mind that record 674 has the string “test” in it’s subTitle column the about of the above is

test

[[CRASH WITH ERROR]]

This doesn’t make sense to me unless SQL Server 2008 has somehow cached the SELECT * query with the previous incarnation of the table, but the strange thing is if I run the query right from within SQL Management Studio there are no problems and it shows all columns with the select *

Frankly this one has me baffled; I know I can get around this by explicitly naming all the desired columns in the select query instead of using * (which is best practice anyway), but I want to understand why this is occurring.

I’ve worked with SQL Server 2005 for many years and never had something like this happen, which leads me to believe it might involve something new in SQL Server 2008; but then again the fact that the query works fine inside of the management studio doesn’t jive with that either.

===UPDATE===

Clearing the Template Cache in the CF admin will solve the issue

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:20:01+00:00Added an answer on May 23, 2026 at 6:20 am

    Yes, ColdFusion caches the <cfquery> SQL string. If the underlying table structure changes, the result might be an exception like you see it.

    Work-arounds:

    • Recommended solutiuons:
      • If you have the development or enterprise version you can view your query cache in the server moniter and clear only the queries there. (comment from @Dpolehonski, thanks)
      • Otherwise, click Clear Template Cache Now in the ColdFusion Administrator (under Server Settings/Caching).
        This will invalidate all cached CFML-Templates on the server and CF will re-compile them when necessary.
    • Quick and dirty:
      Subtly change the query SQL, for example add a space somewhere. When you are on a development machine it’s the quickest way to fix the issue.
      This will invalidate the compiled version of this query only and force a re-compile.
      (Note that removing the subtle change will trigger the error again since the old query text will remain cached.)
    • Brute-force:
      Re-start the ColdFusion server. Brutal, but effective.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting some strange behavior in Firefox whenever I put checkboxes inside a list
I'm getting some strange behavior... when I iterate over the dummyText List in the
I am getting some strange behavior from list view. I need to change background
I'm getting some strange behaviour with my form (using Zend Form). I have a
If I have an inline stylesheet, can and I want - for some strange
I have updated recently to IE 9 and I'm getting some strange issues. I
I'm getting some strange, intermittent, data aborts (< 5% of the time) in some
I'm getting something pretty strange going on when trying to read some data using
I'm getting some weird behaviour recompiling some applications in 2009 that used widestrings at
When using jQuery to POST data back to the server, I'm getting some strange

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.