Re: BUG #14184: Function is running correct but not showing output - Mailing list pgsql-bugs

From Kevin Grittner
Subject Re: BUG #14184: Function is running correct but not showing output
Date
Msg-id CACjxUsMnaCtqyrWN=-zx=Xm6Yj9cZ=7H0XC9_PGY5RRGWFJ7ww@mail.gmail.com
Whole thread Raw
In response to BUG #14184: Function is running correct but not showing output  (zzia88@gmail.com)
List pgsql-bugs
On Mon, Jun 13, 2016 at 8:40 AM,  <zzia88@gmail.com> wrote:

> -----<<<<<<My function Coding>>>>----
> CREATE OR REPLACE FUNCTION FACTORIAL(IN NUM BIGINT,OUT FACT BIGINT) AS $$
> DECLARE
>         FACT BIGINT;
>  BEGIN
>         FOR I IN REVERSE 1..NUM LOOP
>                 FACT:=FACT*I;
>         END LOOP;
> END;
> $$ LANGUAGE plpgsql;
> -----<<<<<<<<<<<<>>>>>>>>>>>>>-----
> SELECT* FROM FACTORIAL(5);
>
> IT SHOWING NULL VALUE...

FACT is NULL on declaration.  NULL (unknown) multiplied by anything is NULL.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-bugs by date:

Previous
From: torben@dannhauer.de
Date:
Subject: BUG #14185: Indentation error in win32.mak let libpq compile fail on USE_OPENSSL=1 -- fix available
Next
From: Tom Lane
Date:
Subject: Re: BUG #14184: Function is running correct but not showing output