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