最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

sql - combine two columns with Firedac or Unidac - Stack Overflow

programmeradmin1浏览0评论

I use FDquery(Firedac), Uniquery(UNidac) to query ms access database on delphi. select asset &" - "& asset_n as nooot from t_komp. this query combines two columns without "-" sign.

NOTE: if I use ADoquery, this query works well.

I use FDquery(Firedac), Uniquery(UNidac) to query ms access database on delphi. select asset &" - "& asset_n as nooot from t_komp. this query combines two columns without "-" sign.

NOTE: if I use ADoquery, this query works well.

Share Improve this question asked Jan 19 at 9:45 user578332user578332 3451 gold badge6 silver badges17 bronze badges 1
  • & is a special character for FireDac related to client side preprocessing. It denotes a substitution variable. Ref: docwiki.embarcadero.com/RADStudio/Sydney/en/… Try setting ResourceOptions.MacroExpand to false. – Brian Commented Jan 19 at 17:42
Add a comment  | 

1 Answer 1

Reset to default 1

The failure might be due to using the character & employed by FireDAC to identify a macro: FireDAC Preprocessing Command Text - Substitution Variables.

You can try two approaches:

  1. Set ResourceOptions.MacroExpands to false.

  2. Modify your SQL query, depending on your DBMS, to:

    select CONCAT(asset,' - ',asset_n) as nooot from t_komp
    

    or

    select CONCAT(CONCAT(asset,' - '),asset_n) as nooot from t_komp
    
发布评论

评论列表(0)

  1. 暂无评论