Subject | Re: [firebird-support] Concatenate integer and string in SQL |
---|---|
Author | Thomas Steinmaurer |
Post date | 2014-03-21T15:02:40Z |
>> FB 1.5Possibly he is coming from a Microsoft SQL Server background, because
>> 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:
'+' 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.