Subject Re: [firebird-support] Concatenate integer and string in SQL
Author W O
Many programming languages also use the '+' symbol as a string concatenation operator, such as: Basic, dBase, Visual FoxPro, etc.

Greetings.

Walter.



On Fri, Mar 21, 2014 at 11:02 AM, Thomas Steinmaurer <ts@...> wrote:
 

>> FB 1.5
>> The following SQL (and variations of it) consistently fail to run (where ClientNameis a domain defined as varchar(20), and Client_ID is a integer):
>>
>> Update ClientInfo CI
>> set ClientName= 'A' + cast(CI.Client_ID as varchar(10))
>>
>> How can I update ClientName?
>
> In SQL the "+" symbol is an arithmetic operator. The string concatenation operator is two pipe symbols ( || ). So:

Possibly he is coming from a Microsoft SQL Server background, because
'+' is used as string concatenation operator there.

--
With regards,
Thomas Steinmaurer
http://www.upscene.com/

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.