use a constant in SELECT statement?

1 view
Skip to first unread message

marc

unread,
Nov 17, 2009, 11:58:37 AM11/17/09
to transfer-dev
Hi,
I retrieve a column and want to prefix it with a constant value so
that I do not retrieve

image1.jpg
image2.jpg
image3.jpg

but

http://mydomain.com/imageresources/image1.jpg
http://mydomain.com/imageresources/image2.jpg
http://mydomain.com/imageresources/image3.jpg

I tried to do this

<cfset local.query = "SELECT :cmsgraphicfolder AS
cmsgraphicfolder,CMS.graphic.serverFileName AS src">
[...]
<cfset local.qTransferObject.setParam("cmsgraphicfolder","http://
mydomain.com/imageresources/","String")>

but this is not allowed in transfer since I get an error message

no viable alternative at input ':cmsgraphicfolder' for TQL:
SELECT :cmsgraphicfolder AS
cmsgraphicfolder,CMS.graphic.serverFileName AS src,[...]

Is there a way to do what I want?

Marc

Cody Caughlan

unread,
Nov 17, 2009, 12:00:46 PM11/17/09
to transf...@googlegroups.com
Why push that logic into the DB layer at all? Just add the prefix at display / use time.

Mark Mandel

unread,
Nov 17, 2009, 7:18:09 PM11/17/09
to transf...@googlegroups.com
I'd second Cody's approach, but if you * really * want that functionality, just write some plain ol' sql.

Mark

--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-qu...

You received this message because you are subscribed to the Google Groups "transfer-dev" group.
To post to this group, send email to transf...@googlegroups.com
To unsubscribe from this group, send email to transfer-dev...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---




--
E: mark....@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

Reply all
Reply to author
Forward
0 new messages