ColdFusion SQL Error - [Table ....] Is Not Indexable By Name

Posted June 12, 2006 at 6:21 PM

Tags: ColdFusion, SQL

I was helping a co-worker of mine tracking down a ColdFusion error he was getting:

 Launch code in new window » Download code as text file »

  • [Table (rows 1 columns ID, PREFIX, FIRST_NAME, MIDDLE_NAME, LAST_NAME, SUFFIX, WORKING_NAME): [ID: coldfusion.sql.QueryColumn@c4736a] [PREFIX:
  • coldfusion.sql.QueryColumn@17542e7] [FIRST_NAME:
  • coldfusion.sql.QueryColumn@17b5ee7] [MIDDLE_NAME:
  • coldfusion.sql.QueryColumn@93ab1f] [LAST_NAME:
  • coldfusion.sql.QueryColumn@c79c37] [SUFFIX:
  • coldfusion.sql.QueryColumn@e0eb96] [WORKING_NAME:
  • coldfusion.sql.QueryColumn@8af270] ] is not indexable by name

I hadn't seen this error before, so the phrase "indexable" immediately made me think about full text indexes and primary keys. After several minutes of moving CFTRY/CFCATCH tags around, we finally found a better error message. It said something like the SELECT column 'name' was not a reference in any of the FROM tables. It was suddenly obvious; in his Query of Queries, the 'name' column was not defined. I find it very funny when simple mistakes take a lot of debugging.

On another note though, I think it is very interesting that the error thrown by the Query of Queries CFQuery tag was different than the one available in CFCATCH. Well, maybe not different at the core, but worded very differently.

Download Code Snippet ZIP File

Post Comment  |  Ask Ben  |  Permalink  |  Other Searches  |  Print Page




Reader Comments

Nov 21, 2006 at 9:30 AM // reply »
1 Comments

I go this error this morning, however I got it when I tried inserting a structure to a row of a query as in:

<cfset Tmp = StructInsert(QueryName[CurrentRow],OtherQueryName,QueryValue,true)>

I was pretty much trying my luck, half-expected the error. I hope this helps.

I'm working on work-around - thanks!


Jun 24, 2008 at 5:31 PM // reply »
1 Comments

I recently was faced with the same problem, but for a different reason: I was trying to implement POIUtility into my application and in the ColumnList I left spaces after each comma. Removing the spaces fixed the problem.


Sep 4, 2009 at 7:11 PM // reply »
1 Comments

@Kamil - thanks for the tip - I just ran into that.


Post Comment  |  Ask Ben

Recent Blog Comments
Nov 22, 2009 at 1:56 AM
Learning ColdFusion 9: Using CFQuery In CFScript Can Enable SQL Injection Attacks
Why adobe would give you script equivalent of cfquery is beyond me. I love cfquery tag because it helps me wriite clean sql, and get away from the horrible jdbc queries If I wanted to write javali ... read »
Nov 22, 2009 at 1:45 AM
Streaming Text Using ColdFusion's CFContent Tag And The Variable Attribute
The reason you would want to do this is to stream. Ack json/xml files to ria clients I used thus technique before because putting json in response stream causes debugging info to come thru As well a ... read »
Nov 21, 2009 at 6:47 PM
Hal Helms - Real World Object Oriented Development, Sarasota - Day Five
@charlie griefer, Thank you.. ... read »
Nov 21, 2009 at 5:15 PM
Using ColdFusion Structures To Remove Duplicate List Values
@Jose Galdamez, Oh heh yeah I didn't paste the whole code. I should have defined the vars -- my bad. It's fixed thou. Thanks. ... read »
Nov 21, 2009 at 4:49 PM
Styling The ColdFusion 8 WriteToBrowser CFImage Output
Great work yet again Ben! Whilst I didn't use this whole code, I copied some of your regex code for a similar problem with the lack of an alt attribute and unescaped ampersands in CFIMAGE for Railo 3 ... read »
Nov 21, 2009 at 1:13 PM
My First ColdFusion Builder Extension - Encrypting And Decrypting CFM / CFC Files
@Ben, Because I am pedantic, I just want to make sure that everyone knows there is absolutely no encryption going on. There is only encoding and obfuscation. The cfencode tool only obfuscates your C ... read »
Nov 21, 2009 at 12:28 PM
Using ColdFusion Structures To Remove Duplicate List Values
@Jody I can't seem to get your code sample to work. If you are still having problems, try this code out and see if it gets you what you wanted. <!--- Comma delimited list with various duplicates ... read »
Nov 21, 2009 at 11:03 AM
Groovy Operator Overloading Does Not Work In The ColdFusion Context
Hi Ben, Thanks for this informative post. Now I am reading ur old posts too ... read »