<cfset qTmp = functionName(arg)>
<cfquery name="qData" dbtype="query">
SELECT staff_id,
col1 AS col1
col2 as col2
....
[position] as [position]
---
FROM qTmp
WHERE col1 = ...
</cfquery>
[position] AS job_title
Steve
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/b3327da9-3d2f-488b-861f-673c77cbd986%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Mar 25, 2015 10:58 PM, "Steve" wrote:
>
> We are currently trying to migrate our website from Coldfusion to work on Lucee and I found an issue where we have used had a column using a SQL reserved word as the name (in this case 'position') inside a query result that is then queried in CFML. We are using square brackets to escape the column name in Coldfusion
Try using double quotes instead, that is the identifier quote according to the SQL Standard. (And it is wat more portable than that MS-ism.)
Jochem
<cfquery name="qData" dbtype="query">
SELECT staff_id,
job_title AS job_title
FROM qTmp
GROUP BY staff_id, job_title
</cfquery>