Subject | Re: [firebird-support] How to concatenate strings in UPDATE statement ? |
---|---|
Author | Helen Borrie |
Post date | 2007-06-12T08:27Z |
At 05:37 PM 12/06/2007, you wrote:
SUBSTRING() function is wrong.
UPDATE PROJECTS
SET CODE = 'J.P.' || SUBSTRING(CODE from 1 for 3)
./heLen
Tip: MySQL isn't an ideal reference for standard SQL language. :-)
>I am using Firebird 2.0.1 (on Windows) and I am having a following SQLYou have the concatenation operator right but the syntax for the
>problem:
>
>I have to port following SQL that works fine on Mysql:
>
>UPDATE PROJECTS SET CODE = CONCAT('J.P.', SUBSTRING(CODE,3))
>
>It seems that there is no CONCAT method in Firebird, so I've run
>google search to see what operator could I use for this
>
>I've tried following query variants, but all of them report SQL error!
>
>UPDATE PROJECTS SET CODE = 'J.P.' || SUBSTRING(CODE,3)
>UPDATE PROJECTS SET CODE = ('J.P.' || SUBSTRING(CODE,3))
>UPDATE PROJECTS SET CODE = 'J.P.' + SUBSTRING(CODE,3)
>
>Can anyone suggest a working solution ?
SUBSTRING() function is wrong.
UPDATE PROJECTS
SET CODE = 'J.P.' || SUBSTRING(CODE from 1 for 3)
./heLen
Tip: MySQL isn't an ideal reference for standard SQL language. :-)