Re: plpgsql loop not returning value

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Josh Close <narshe(at)gmail(dot)com>
Cc: POSTGRES <pgsql-general(at)postgresql(dot)org>
Subject: Re: plpgsql loop not returning value
Date: 2004-10-16 16:20:35
Message-ID: 20041016162034.GA71806@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Oct 16, 2004 at 09:30:32AM -0500, Josh Close wrote:
> On Sat, 16 Oct 2004 00:59:34 -0600, Michael Fuhr <mike(at)fuhr(dot)org> wrote:
> >
> > Add some RAISE INFO statements to print variables' values at key
> > places. I wonder if one of your SUMs is returning NULL, causing
> > your addition to evaluate to NULL. If so, then perhaps you should
> > use COALESCE to turn those NULLs into zeros.
>
> Thanks. That's exactly what was happening. I'm still new to postgres.

Glad you got it working.

A question about your design: you appear to have a tblBatchHistory_X
table for each iId value in tblServers. Is there a reason for doing
that instead of having a single tblBatchHistory table with a foreign
key reference to tblServers?

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc G. Fournier 2004-10-16 16:48:36 Re: pgsql cvs
Previous Message Tom Lane 2004-10-16 16:15:18 Re: Avoiding sequential scans with OR join condition