Re: plpgsql: Bush becomes a null, can not execute null query

Поиск
Список
Период
Сортировка
От Josh Goldberg
Тема Re: plpgsql: Bush becomes a null, can not execute null query
Дата
Msg-id 3F4E422E.7050709@4dmatrix.com
обсуждение исходный текст
Ответ на plpgsql: Bush becomes a null, can not execute null query  (Mauri Sahlberg <Mauri.Sahlberg@claymountain.com>)
Ответы Re: plpgsql: Bush becomes a null, can not execute null query
Список pgsql-admin
Concatenating a null value makes the string null.  try:
SELECT 'foo'||NULL||'bar';

Just add a condition to check rivi.suoritus for null before making an
assignment.



Mauri Sahlberg wrote:

>returns nothing - bush becomes null and everything fails. I do not
>undestand why bush becomes null when the query returns nothing.
>
>

>     bush:=''select * from PaivanLeimat('' ||
>    quote_literal(aYritys) ||
>    ''::varchar,'' ||
>        quote_literal(nyt) ||
>        ''::date,''||
>        quote_literal(aKtunnus) ||
>        ''::varchar,'' ||
>        latest
>        ||'')'';
>
>
<snip>

>     latest:=rivi.suoritus;
>
>



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

Предыдущее
От: Jean-Luc Lachance
Дата:
Сообщение: Re: Extracting single coordinate from a box
Следующее
От: "Mauri Sahlberg"
Дата:
Сообщение: Re: plpgsql: Bush becomes a null,