Re: plpgsql: Bush becomes a null, can not execute null query
| От | Oleg Bartunov | 
|---|---|
| Тема | Re: plpgsql: Bush becomes a null, can not execute null query | 
| Дата | |
| Msg-id | Pine.GSO.4.56.0308290117300.1651@ra.sai.msu.su обсуждение исходный текст  | 
		
| Ответ на | Re: plpgsql: Bush becomes a null, can not execute null query (Josh Goldberg <josh@4dmatrix.com>) | 
| Список | pgsql-admin | 
On Thu, 28 Aug 2003, Josh Goldberg wrote:
> 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.
or better use coalesce
>
>
>
> 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;
> >
> >
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
    Regards,
        Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
		
	В списке pgsql-admin по дате отправления: