I'm familiar with this sort of syntax in SQL Server, to concatenate strings in my result set:
SELECT 'foo' + bar AS SomeCol
FROM SomeTable
I would like to do something similar inside a ColdFusion Query of Queries:
<cfquery name="qOptimize" dbtype="query">
select
image_id AS imageId,
'#variables.img_root#' + image_id + '.' + image_ext AS fullImage,
'#variables.img_root#' + image_id + 't.' + image_ext AS thumbnailImage,
from qLookup
order by imageId asc
</cfquery>
This is part of a service consumed by a Flex application, so I'm optimizing the result of a stored procedure used elsewhere in the application before returning to the client -- stripping out unused columns, and compiling image URLs from some dynamic path information.
I could write a new stored procedure that takes the image root as a parameter and does all of this, and I probably will for performance reasons, but the question is still nagging me. I haven't found a syntax that works yet, so I wonder if it's possible.
When I try the above, I get the following error:
Query Of Queries syntax error.
Encountered "from. Incorrect Select List, Incorrect select column,
Has anyone done this? Is it possible, perhaps with another syntax?