Re: LOOping clobbering variable

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: K Anderson <msmouse(at)kittymail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: LOOping clobbering variable
Date: 2005-01-02 05:16:23
Message-ID: 20050101211354.A76126@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sat, 1 Jan 2005, 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.

Is it possible that you're ending up with a NULL after the loop? NULL
concatenated with anything is still NULL. If any of the various fields
you're concatenating in could be NULL you'll need to guard against that.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message K Anderson 2005-01-02 23:06:08 Re: LOOping clobbering variable
Previous Message Michael Fuhr 2005-01-02 05:07:00 Re: LOOping clobbering variable