On 3/24/12, Andreas Kretschmer <akretschmer(at)spamfence(dot)net> wrote:
> Rehan Saleem <pk_rehan(at)yahoo(dot)com> wrote:
>> hi ,
>> how can we concatinate these lines and execute sql command
>> set sql = 'select user,username, firstname '
>> set sql += ' lastname, cardno from table1 where userid=' + 5
> sql = sql || ' bla fasel';
> || is the concat - Operator.
> Really, I'm not out to destroy Microsoft. That will just be a completely
> unintentional side effect. (Linus Torvalds)
> "If I was god, I would recompile penguin with --enable-fly." (unknown)
> Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
You may want to ensure that none of variables to be concatenated is
NULL, else the end result will be NULL.
"coalesce" function provides means to provide an substitute value for
a variable that may be NULL.
In response to
pgsql-sql by date
|Next:||From: Rehan Saleem||Date: 2012-03-26 07:49:07|
|Subject: MS-SQL to PostgreSql|
|Previous:||From: Andreas Kretschmer||Date: 2012-03-24 11:57:14|
|Subject: Re: how to concatenate in PostgreSQL|