CFOUTPUT QUERY (column names contains spaces)
Posted on 2005-04-05
OK, I'm trying to run a select query from a database that I'm connecting to (of which I have no control over the table design).
The column name is TestCode.
My query is as follows:
<cfquery name="test_query" datasource="dsn">
select TestCode from TestProc where TestITN=1
<cfdump var="#test_query#"> returns the following:
Notice the space between Test and Code. I find out that it's not returning the column name (in the column list), rather the column description field from the database, which is no good.
So, I try to alias the column (ie, select TestCode as test_code) ...nothing. It seems to ignore my alias and returns "Test Code" each time (which again appears to be the description in the db for the column) which I cannot reference when looping the recordset.
Any ideas as to how I can get to the data? Why would my alias not be working?