Re: BUG #14184: Function is running correct but not showing output

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14184: Function is running correct but not showing output
Дата
Msg-id 17998.1465831524@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14184: Function is running correct but not showing output  (zzia88@gmail.com)
Список pgsql-bugs
zubair alam <zzia88@gmail.com> writes:
> CREATE OR REPLACE FUNCTION FACTORIAL(IN NUM BIGINT,OUT FACT BIGINT) AS $$
> DECLARE
> FACT BIGINT:=1;
>  BEGIN
>   FOR I IN REVERSE 1..NUM LOOP
> FACT:=FACT*I;
> END LOOP;
> END;
> $$ LANGUAGE plpgsql;

> if i am doing FACT BIGINT:=1; the also it giving the output NULL;

Well, the *third* bug in your function is that you're re-declaring
FACT as a local variable, thereby masking the output parameter.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14184: Function is running correct but not showing output
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14185: Indentation error in win32.mak let libpq compile fail on USE_OPENSSL=1 -- fix available