Re: string is sometimes null ? - Mailing list pgsql-general

From Stephan Szabo
Subject Re: string is sometimes null ?
Date
Msg-id 20040929094300.U63616@megazone.bigpanda.com
Whole thread Raw
In response to string is sometimes null ?  (Graeme Hinchliffe <graeme.hinchliffe@zeninternet.co.uk>)
Responses Re: string is sometimes null ?  (Graeme Hinchliffe <graeme.hinchliffe@zeninternet.co.uk>)
List pgsql-general
On Wed, 29 Sep 2004, Graeme Hinchliffe wrote:

>     The RADIUS server is reporting problems when trying to write START of
> accounting entries, and the error given is:
>
> ERROR:  cannot EXECUTE a null querystring CONTEXT:  PL/pgSQL function
> "radacct_trig" line 43 at open
>
> The lines its refering to are:
>
> --- START ---
>
> str:=''SELECT
> username,year_of_jan,current_in,current_out,current_start,last_update,m''||monthcurr||''_in
> AS monthin,m''||monthcurr||''_out AS monthout
>   FROM customer_stats WHERE username=''''''||username||'''''''';

If monthcurr or username are null, the above will be null.
Anything || NULL => NULL.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Composite Type Argument Construction to a Function
Next
From: Shelby Cain
Date:
Subject: Re: PostgreSQL Installation Question