Re: postgresql function not accepting null values inselect statement

Поиск
Список
Период
Сортировка
От johnf
Тема Re: postgresql function not accepting null values inselect statement
Дата
Msg-id 200802220830.56917.jfabiani@yolo.com
обсуждение исходный текст
Ответ на Re: postgresql function not accepting null values inselect statement  ("Bart Degryse" <Bart.Degryse@indicator.be>)
Ответы Re: postgresql function not accepting null values inselect statement  ("Jyoti Seth" <jyotiseth2001@gmail.com>)
Re: postgresql function not accepting null values inselect statement  ("Robins Tharakan" <tharakan@gmail.com>)
Список pgsql-sql
On Friday 22 February 2008 01:35:47 am Bart Degryse wrote:
> Can you try this...
>
> CREATE OR REPLACE FUNCTION getfunctionaries(p_statecd integer)
>   RETURNS SETOF t_functionaries AS
> $BODY$
> DECLARE
>   rec t_functionaries%ROWTYPE;
> BEGIN
>   FOR rec IN (
>     SELECT f.functionaryid, f.category, f.description
>     FROM functionaries f
>     WHERE f.statecd IS NOT DISTINCT FROM p_statecd)
>   LOOP
>     return next rec;
>   END LOOP;
>   return;
> END;
> $BODY$
> LANGUAGE 'plpgsql' VOLATILE;
>
a newbie question.  Could you explain why yours works?  I don't understand how 
it works if p_statecd = NULL


-- 
John Fabiani


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: SQL standards in Mysql
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: SQL standards in Mysql