From: Josh Goldberg <josh@4dmatrix.com>
To: Mauri.Sahlberg@pretax.net
Cc: pgsql-admin@postgresql.org
Subject: Re: plpgsql: Bush becomes a null, can not execute null query
Date: Thu, 28 Aug 2003 10:55:58 -0700
Message-ID: <3F4E422E.7050709@4dmatrix.com> (raw)
In-Reply-To: <1062056068.19315.24.camel@taekwondo.intra.pretax.net>
References: <1062056068.19315.24.camel@taekwondo.intra.pretax.net>
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;
>
>
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: josh@4dmatrix.com, Mauri.Sahlberg@pretax.net
Subject: Re: plpgsql: Bush becomes a null, can not execute null query
In-Reply-To: <3F4E422E.7050709@4dmatrix.com>
References: <1062056068.19315.24.camel@taekwondo.intra.pretax.net> <3F4E422E.7050709@4dmatrix.com>
* 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