Re: LOOping clobbering variable

From: "K Anderson" <msmouse(at)kittymail(dot)com>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: LOOping clobbering variable
Date: 2005-01-02 23:06:08
Message-ID: 20050102230608.EA6181027BE@ws3.hk5.outblaze.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


----- Original Message -----
From: "Michael Fuhr" <mike(at)fuhr(dot)org>
To: "K Anderson" <msmouse(at)kittymail(dot)com>
Subject: Re: [NOVICE] LOOping clobbering variable
Date: Sat, 1 Jan 2005 22:07:00 -0700

>
> On Sat, Jan 01, 2005 at 07:38:16PM -0800, K Anderson wrote:
>
> > The enclosed function returns a proper result only when the LOOP
> > and its enclosed functionality is removed from the function. Notice
> > near the return I have xml=xml||'</transaction>';
> >
> > That should at the least return what ever is in xml with
> > </transaction> concatinated, or so I would hope. But it's empty.
>
> I'd guess that one of the values you're concatenating is NULL.
> Concatenating NULL with anything results in NULL, so if you assign
> that back to xml then all subsequent concatenations will also result
> in NULL.
>
> You can use COALESCE to convert NULLs to empty strings.
Thanks Michael that did the trick. I still don't get it though. Seems like bad behavior to say the NULL||</transaction> results in NULL and not NULL</transaction> or even </transaction>.

--
_______________________________________________
Get your free email from http://www.kittymail.com

Powered by Outblaze

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2005-01-02 23:47:13 Re: LOOping clobbering variable
Previous Message Stephan Szabo 2005-01-02 05:16:23 Re: LOOping clobbering variable