pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oleg Bartunov <oleg@sai.msu.su>
To: Josh Goldberg <josh@4dmatrix.com>
Cc: Mauri.Sahlberg@pretax.net
Cc: pgsql-admin@postgresql.org
Subject: Re: plpgsql: Bush becomes a null, can not execute null query
Date: Fri, 29 Aug 2003 01:17:43 +0400 (MSD)
Message-ID: <Pine.GSO.4.56.0308290117300.1651@ra.sai.msu.su> (raw)
In-Reply-To: <3F4E422E.7050709@4dmatrix.com>
References: <1062056068.19315.24.camel@taekwondo.intra.pretax.net>
	<3F4E422E.7050709@4dmatrix.com>

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



view thread (4+ messages)

Message-ID: <Pine.GSO.4.56.0308290117300.1651@ra.sai.msu.su>
Permalink:  ../Pine.GSO.4.56.0308290117300.1651@ra.sai.msu.su/
Also on:    postgresql.org/message-id/Pine.GSO.4.56.0308290117300.1651@ra.sai.msu.su

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: oleg@sai.msu.su, josh@4dmatrix.com, Mauri.Sahlberg@pretax.net
  Subject: Re: plpgsql: Bush becomes a null, can not execute null query
  In-Reply-To: <Pine.GSO.4.56.0308290117300.1651@ra.sai.msu.su>
  References: <1062056068.19315.24.camel@taekwondo.intra.pretax.net> <3F4E422E.7050709@4dmatrix.com> <Pine.GSO.4.56.0308290117300.1651@ra.sai.msu.su>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox