Thread: String Concatnation

String Concatnation

From
Najm Hashmi
Date:
Hi,How can I concatnate   two varialbles, seperated by a |,  that are type text
together?
v, v1 text;
some work
then
res:= v ||''|''|| v1;
this syntex does not work in plpgsql??
Any ideas how to do it ???
Thanks.
Najm



Re: String Concatnation

From
"Brett W. McCoy"
Date:
On Sat, 10 Feb 2001, Najm Hashmi wrote:

>  How can I concatnate   two varialbles, seperated by a |,  that are type text
> together?
> v, v1 text;
> some work
> then
> res:= v ||''|''|| v1;

What error is it giving?  Do you need to be using two single quotes in the
statement?

-- Brett                                    http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
There is a certain impertinence in allowing oneself to be burned for an opinion.    -- Anatole France



Re: String Concatnation

From
Stephan Szabo
Date:
I was able to do a function that took two arguments and did
that under 7.1beta3 with no trouble.
What message are you getting?

On Sat, 10 Feb 2001, Najm Hashmi wrote:

> Hi,
>  How can I concatnate   two varialbles, seperated by a |,  that are type text
> together?
> v, v1 text;
> some work
> then
> res:= v ||''|''|| v1;
> this syntex does not work in plpgsql??
> Any ideas how to do it ???
> Thanks.
> Najm
> 



Re: String Concatnation

From
Jie Liang
Date:
Hi,

You can use every sql function and operator in plpgsql, so
v||''|''||v2 is OK.
however, you cannot do:
declare
v,v2 text;
you should do:
v text;
v2 text;

also you initialize like:
v text:='''';

Jie LIANG

St. Bernard Software
Internet Products Inc.

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang@ipinc.com
www.stbernard.com
www.ipinc.com

On Sat, 10 Feb 2001, Najm Hashmi wrote:

> Hi,
>  How can I concatnate   two varialbles, seperated by a |,  that are type text
> together?
> v, v1 text;
> some work
> then
> res:= v ||''|''|| v1;
> this syntex does not work in plpgsql??
> Any ideas how to do it ???
> Thanks.
> Najm
>