ColdFusion Error: The Column Name "3a" Is Invalid

Posted June 22, 2006 at 1:56 PM

Tags: ColdFusion

I was writing some test code for a query I am working with and I got the error: The column name "3a" is invalid. I was trying to run this line of code:

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

  • qTest = QueryNew( "id, name, 3a" );

While "3a" might seem like a strange column name, that is indeed the name of a column (along with MANY others that start with a number) in an actual client database. It works fine when writing SQL statements:

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

  • SELECT
  • id,
  • name,
  • [3a]
  • FROM
  • test

... because I can use the [ ] notation: [3a]. I tried to use the similar notation in the QueryNew() method, but to no avail:

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

  • qTest = QueryNew( "id, name, [3a]" );

This gives me the same error. I guess you can't simulate poorly named columns in QueryNew(). I would say that's a bug, but is it? If anything it's a flag that says "Don't name your columns with numbers."

Download Code Snippet ZIP File

Comments (0)  |  Post Comment  |  Ask Ben  |  Permalink  |  Print Page



Adobe ColdFusion 8.0.1 Update - Helping Programmers To Be Signifanctly Less Girlie - Download ColdFusion 8 Update 8.0.1 Now.

Reader Comments

There are no comments posted for this web log entry.


Post Comment  |  Ask Ben


Home   |   Web Log   |   ColdFusion   |   Projects   |   Resume   |   Job Form   |   Search   |   Contact
Epicenter Consulting - Custom Software Solutions for Business Evolution HostMySite.com - The Leader In ColdFusion Hosting