Re: [SQL] postgresql function not accepting null values inselect statement

2008-02-24 Thread Robins Tharakan
ED] [mailto: > > [EMAIL PROTECTED] > > On Behalf Of johnf > > Sent: Friday, February 22, 2008 10:01 PM > > To: pgsql-sql@postgresql.org > > Subject: Re: [SQL] postgresql function not accepting null values > > inselect > > statement > > >

Re: [SQL] postgresql function not accepting null values inselect statement

2008-02-24 Thread Robins Tharakan
http://www.postgresql.org/docs/current/static/functions-comparison.html This document states this: Lets assume: A = NULL B = 10 C = NULL SELECT 1 WHERE A = B returns no rows SELECT 1 WHERE A = C returns no rows (even though both A and C are NULL) SELECT 1 WHERE A IS NOT DISTINCT FROM C returns 1

Re: [SQL] postgresql function not accepting null values inselect statement

2008-02-24 Thread Jyoti Seth
gresql.org Subject: Re: [SQL] postgresql function not accepting null values inselect statement 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 >

Re: [SQL] postgresql function not accepting null values inselect statement

2008-02-22 Thread johnf
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.categ

Re: [SQL] postgresql function not accepting null values inselect statement

2008-02-22 Thread Bart Degryse
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 DISTI