Concatenate string in SQL update
Posted in 1999
Poster wanted to append text to a CHAR column in an UPDATE on SQL/SE 4.1, finding that '+' and '&' didn't work and no concatenation operator was documented. Replies pointed to Informix's double-pipe (||) operator, but trying it produced error 202 (illegal character). Jonathan Leffler explained why: || concatenation only arrived in version 5.0 (late 1990/early 1991), so the poster's older 4.1 release simply lacks it. No workaround for 4.1 is given; the poster said he'd look for another approach.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: General Discussion
Hi all I'm struggling to find an answer when I thought it would be simple .. I've got SQL/SE v4.1 I want to append some text to specific CHAR columns but I can not find the concatenate string operator. There must be one surely? Example Update table Set column = column + "extra text" The above fails because plus sign is arithmetic operator, therefore expression evaluates to null and I get error. I've tried & sign but this gives syntax error. Can find nothing in manuals. Thanks in advance Martin
I believe the comma is the operator your looking for. Martin Sandford wrote: > Hi all > > I'm struggling to find an answer when I thought it would be simple .. > > I've got SQL/SE v4.1 > > I want to append some text to specific CHAR columns but I can not > find the concatenate string operator. There must be one surely? > > Example > Update table > Set column = column + "extra text" > > The above fails because plus sign is arithmetic operator, therefore > expression evaluates to null and I get error. I've tried & sign > but this gives syntax error. Can find nothing in manuals. > > Thanks in advance > > Martin
Thanks to all who emailed me with the suggestion to try || (pipe pipe) Martin
Martin Sandford wrote: > > Thanks to all who emailed me with the suggestion > to try || (pipe pipe) > > Martin Aarrrggghhhh! Spoke too soon If I try and use || I get error 202 illegal character Any other ideas anyone? Martin
Thanks for all the comments. Concatenation not a feature of my version. Guess I'll have to try something else. Appreciate everyone taking time to share their expertise. Martin
Martin, Informix's string concatenation operator is a double pipe ( || ). Example: "This data " || "That data." becomes "This data That data." HTH, Kind regards, John. In article <374180B1.95F01828@audionri.enterprise-plc.com>, Martin Sandford <martin@audionri.enterprise-plc.com> wrote: > Hi all > > I'm struggling to find an answer when I thought it would be simple .. > > I've got SQL/SE v4.1 > > I want to append some text to specific CHAR columns but I can not > find the concatenate string operator. There must be one surely? > > Example > Update table > Set column = column + "extra text" > > The above fails because plus sign is arithmetic operator, therefore > expression evaluates to null and I get error. I've tried & sign > but this gives syntax error. Can find nothing in manuals. > > Thanks in advance > > Martin > -- <><><><><><><> John Bejarano San Mateo, CA <><><><><><><> --== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.---
It's either | or || depending on what tool you are using... David On Tue, 18 May 1999 16:01:05 +0100, Martin Sandford <martin@audionri.enterprise-plc.com> wrote: >Hi all > >I'm struggling to find an answer when I thought it would be simple .. > >I've got SQL/SE v4.1 > >I want to append some text to specific CHAR columns but I can not >find the concatenate string operator. There must be one surely? > >Example > Update table > Set column = column + "extra text" > >The above fails because plus sign is arithmetic operator, therefore >expression evaluates to null and I get error. I've tried & sign >but this gives syntax error. Can find nothing in manuals. > >Thanks in advance > > >Martin
Of course it's a "feature"... geez! Tell us ALL what "version" you have... NOBODY would ever buy that product... David Russell On Wed, 19 May 1999 14:12:47 +0100, Martin Sandford <martin@audionri.enterprise-plc.com> wrote: >Thanks for all the comments. >Concatenation not a feature of my version. >Guess I'll have to try something else. > >Appreciate everyone taking time to share their expertise. > > >Martin
David Russell wrote: > Of course it's a "feature"... geez! Tell us ALL what "version" you > have... NOBODY would ever buy that product... If you look at the original question, the version in Martin has is SE version 4.1. This has not been available to customers for a number of years now -- it was released around 1989 and version 5.0 (which had the || concatenation operator) was released at the very end of 1990 (functionally, January 1991). Please be a little thoughtful before tearing into someone who did actually provide the information you sought, albeit not in the message to which you responded. > On Wed, 19 May 1999 14:12:47 +0100, Martin Sandford > <martin@audionri.enterprise-plc.com> wrote: > > >Thanks for all the comments. > >Concatenation not a feature of my version. > >Guess I'll have to try something else. > > > >Appreciate everyone taking time to share their expertise. > > > >Martin -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>