Re: Appending strings to columns
Posted in 1994
> >
> >Try:
> >
> >SELECT column1 || "a text string" FROM table1 WHERE xxxxxxxx INTO temp x;
> >UPDATE table1 set column1 = (select column1 from x) WHERE xxxxxxxx ;
> >drop table x;> >
> I personally don't think that your statement is syntactically supported by
> Informix. I am using 4.1 and I may be wrong.8-(
>
> Duc - AT&T
> hhong@nova.umd.edu
>
Absolutely correct. I did not 'name' the virtual column. It should have been:
SELECT column1 || "a text string" col1 FROM table1 WHERE xxxxxxxx INTO temp x;
UPDATE table1 set column1 = (select col1 from x) WHERE xxxxxxxx;
drop table x;
The only other problem is that the select statement doesn't clip column1, so
the trailing spaces are still in there and you wind up with nothing anyway.
BUT if column1 is a varchar it will indeed work properly.
j.
_____________________________________________________________________________
Jack Parker |
Hewlett Packard, BSMC Boise, Idaho, USA| He who talks most, talks least.
jparker@hpbs3645.boi.hp.com |
_____________________________________________________________________________
Any opinions expressed herein are my own and not those of my employers.
_____________________________________________________________________________