Subject | RE: [firebird-support] Escaping an ampersand in a select |
---|---|
Author | Svein Erling Tysvær |
Post date | 2014-07-08T05:54:37Z |
>I am using Delphi XE6 and Firedac and my query is similar toAs Mark said, this is not Firebird related, and hence off-topic for this list.
>
>SELECT A.NAME, 'HTTP://WWW.XYZ.COM?URN=' || A.URN || '&ACTION=' || A.ACTIONFIELD
>FROM MYTABLE
>
>the problem I have is that the returned result doesn't include the &ACTION so it looks like HTTP://WWW.XYZ.COM?URN=1234=myaction
>
>I have tried various ways of escaping the & but no joy.
A quick search on the Internet, gives this likely answer from DA-SOFT Technologies Support Team (however, an answer for AnyDAC, not FireDAC):
"1) AnyDAC recognizes '&' and '!' as macros marker. To disable macro processing set ResourceOptions.MacroCreate and MacroExpand to False. More about that:
www.da-soft.com/anydac/docu/Preprocessing_Command_Text.html
2) Still the best is to use parameters instead of literals."
HTH,
Set