Re: plpgsql always returning null..
От | Anand Raman |
---|---|
Тема | Re: plpgsql always returning null.. |
Дата | |
Msg-id | 20010203000917.E8084@india-today.com обсуждение исходный текст |
Ответ на | Re: plpgsql always returning null.. (Stephan Szabo <sszabo@megazone23.bigpanda.com>) |
Ответы |
Re: plpgsql always returning null..
|
Список | pgsql-general |
hi we have 2 databases on the test environment both running 702 .. The answer for consitent in both the machines.. Both the databases when queries returned null.. The table inventory is a very simple 2 column table containing exhibit_distribution_id and quantity as the column.. arttoday=# select * from inventory; exhibit_distribution_id | quantity -------------------------+---------- 453 | 59 454 | 31 455 | 71 456 | 54 457 | 51 458 | 55 459 | 68 460 | 44 461 | 60 .. .. .. 594 | 70 Regards Anand On Fri, Feb 02, 2001 at 09:37:08AM -0800, Stephan Szabo wrote: > >I don't see this on my test on 7.1beta3, can you give the >table schema and some sample data? > >On Fri, 2 Feb 2001, Anand Raman wrote: > >> hi guys >> I am trying out a simple plpgsql function on 702 >> >> drop function quantity_available(int4); >> CREATE FUNCTION quantity_available (int4) RETURNS INT4 AS ' >> DECLARE >> totq int4; >> BEGIN >> select INTO totq cast(quantity as INT4) from inventory >> where exhibit_distribution_id=$1; >> return totq; >> END;' >> LANGUAGE 'plpgsql'; >> >> select quantity_available(594); >> >> is always returning null even when there is correponding data >> >> arttoday=# select quantity from inventory where exhibit_distribution_id = 594; >> quantity >> ---------- >> 1 >> (1 row) >> >> Can some one please explain this anamoly.. >> >> Thanks >> Anand >>
В списке pgsql-general по дате отправления: