Subject | Re: [firebird-support] How to concatenate strings in UPDATE statement ? |
---|---|
Author | Svein Erling Tysvær |
Post date | 2007-06-12T08:24:08Z |
UPDATE PROJECTS SET CODE = 'J.P.' || SUBSTRING(CODE FROM 1 FOR 3)
I don't know what SUBSTRING(CODE,3) actually means, the above statement should get the first three letters.
HTH,
Set
miroslav_rajcic wrote:
I don't know what SUBSTRING(CODE,3) actually means, the above statement should get the first three letters.
HTH,
Set
miroslav_rajcic wrote:
> I am using Firebird 2.0.1 (on Windows) and I am having a following SQL[Non-text portions of this message have been removed]
> 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 ?
>
> TIA.
>
> Regards,
> Miroslav