Unix Technical Forum

Re: LOOping clobbering variable

This is a discussion on Re: LOOping clobbering variable within the pgsql Novice forums, part of the PostgreSQL category; --> ----- Original Message ----- From: "Michael Fuhr" <mike@fuhr.org> To: "K Anderson" <msmouse@kittymail.com> Subject: Re: [NOVICE] LOOping clobbering variable Date: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:18 PM
K Anderson
 
Posts: n/a
Default Re: LOOping clobbering variable


----- Original Message -----
From: "Michael Fuhr" <mike@fuhr.org>
To: "K Anderson" <msmouse@kittymail.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

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 09:18 PM
Michael Fuhr
 
Posts: n/a
Default Re: LOOping clobbering variable

On Sun, Jan 02, 2005 at 03:06:08PM -0800, K Anderson wrote:
>
> Seems like bad behavior to say the NULL||</transaction> results
> in NULL and not NULL</transaction> or even </transaction>.


Others will disagree; take it up with the standards committee.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:19 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com