Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL column names with spaces

Status
Not open for further replies.

gareth7

Programmer
Oct 11, 2002
35
GB
Is there any way to use a column name with spaces in it in cfoutput?

An example sql statment would be:

SELECT [first name]
FROM myTable

I then want to output the values using something like #myQuery.[first name]# but cold fusion isn't accepting this.

I know you can use column aliases, but I'm working on a table with 70 columns and I'd rather do a SELECT * than have to specifiy an alias in every query.
 
I'm pretty sure ColdFusion (or, rather, the database driver) automatically converts spaces in column names to underscores... so you should be able to access it via
Code:
#myQuery.first_name#




-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top