I am familiar with a similar syntax in SQL Server to concatenate strings in my result set:
SELECT 'foo' + bar AS SomeCol FROM SomeTable
I would like to do something like this in a ColdFusion query request:
<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 the service consumed by the Flex application, so I optimize the result of the stored procedure used elsewhere in the application before returning to the client - remove unused columns and compile image URLs from some dynamic path information.
I could write a new stored procedure that takes the root of the image as a parameter and does all this , and I will probably work for performance reasons , but the question is still shaking me. I have not yet found a syntax that works, so I am wondering if this is possible.
When I try the above, I get the following error:
Query Of Queries syntax error.
Invalid selection list, Invalid selection column,
Has anyone done this? Is it possible, perhaps with a different syntax?
coldfusion sql
Adam tuttle
source share