Unified SQL function {fn CONCAT}

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

Unified SQL function {fn CONCAT}

Post by FredS » Mon 20 Apr 2015 02:44

The Unified SQL function CONCAT does not appear to work as designed.

Code: Select all

{fn CONCAT('a', 'b', 'c')} 
Returns 'ab' instead of 'abc'.
I checked the help and it states: Concatenates several string expressions.

Fair enough add a forth string to see if it just skips the last and I get a Macro error. Apparently 4 is more than several but 3 params is OK..

The most annoying part of this is that I have source code and went to see what is what so I don't have to post.. a searched the source for 'CONCAT' and that gave me a single comment in source code?

How come, is source not source?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Unified SQL function {fn CONCAT}

Post by AlexP » Mon 20 Apr 2015 13:01

Hello,

All the functions are declared in XXXUniProvider modules (for example, SQLiteUniProvider) in the initialization section. The CONCAT function gets 2 arguments, however, since the format standard method doesn't raise an error in case when the number of arguments is less than the number of values, then you are getting a correct result. The maximum number of arguments for functions is 3, and we raise an error if you transfer a larger number. This behavior is implemented in the TUniSqlFormatter.ProcessFunction method.

FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

Re: Unified SQL function {fn CONCAT}

Post by FredS » Mon 20 Apr 2015 20:52

Hi AlexP,

That explains the fn Functions parameters, it doesn't explain why XE7 couldn't find the source code entries yesterday even when run with "include subdirs".

thanks

Fred

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Unified SQL function {fn CONCAT}

Post by AlexP » Tue 21 Apr 2015 08:13

Try specify the path to the sources in the Library Path (insert before the links to Bin and Lib folder of UniDAC).

Post Reply