Re: plpgsql: Bush becomes a null, can not execute null query - Mailing list pgsql-admin

From Josh Goldberg
Subject Re: plpgsql: Bush becomes a null, can not execute null query
Date
Msg-id 3F4E422E.7050709@4dmatrix.com
Whole thread Raw
In response to plpgsql: Bush becomes a null, can not execute null query  (Mauri Sahlberg <Mauri.Sahlberg@claymountain.com>)
Responses Re: plpgsql: Bush becomes a null, can not execute null query
List 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;
>
>



pgsql-admin by date:

Previous
From: Jean-Luc Lachance
Date:
Subject: Re: Extracting single coordinate from a box
Next
From: "Mauri Sahlberg"
Date:
Subject: Re: plpgsql: Bush becomes a null,