concat strings but spaces

Поиск
Список
Период
Сортировка
От Matthias Teege
Тема concat strings but spaces
Дата
Msg-id slrnc6ibke.306f.matthias@one.mteege.de
обсуждение исходный текст
Ответы Re: concat strings but spaces  (Joe Conway <mail@joeconway.com>)
Re: concat strings but spaces  (Ron St-Pierre <rstpierre@syscor.com>)
Список pgsql-general
Moin,

I try to concat values from three fields in a function like this:

create or replace function
 fconcat_name(varchar, varchar, varchar) returns varchar as '
    declare
    ttl alias for $1;
    vnm alias for $2;
    nme alias for $3;
    begin
     return ttl || '' '' || vnm || '' '' || nme;
    end;
' language plpgsql;

That works but if one of the fields is empty there are to much
spaces in the result. Is there any alternative to a monster
if-then construct?

Many thanks
Matthias


В списке pgsql-general по дате отправления:

Предыдущее
От: vadimtro_invalid@yahoo.com (Vadim Tropashko)
Дата:
Сообщение: Re: self referencing tables/ nested sets etc...
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Cursors and Transactions, why?