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

From: Josh Goldberg <josh(at)4dmatrix(dot)com>
To: Mauri(dot)Sahlberg(at)pretax(dot)net
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: plpgsql: Bush becomes a null, can not execute null query
Date: 2003-08-28 17:55:58
Message-ID: 3F4E422E.7050709@4dmatrix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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;
>
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jean-Luc Lachance 2003-08-28 17:57:29 Re: Extracting single coordinate from a box
Previous Message Donald Fraser 2003-08-28 17:12:03 Re: Extracting single coordinate from a box