How to pickup null values in SQL Language?

From: Tahira Aslam <tahira_aslam(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to pickup null values in SQL Language?
Date: 2002-05-30 11:42:14
Message-ID: 20020530114214.53434.qmail@web11003.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I have written this function in SQL Language in postgresql 7.2.

CREATE FUNCTION MyFunction() RETURNS SETOF Text AS '

Select MyView."Document_ID"||','||MyView."First_Name"||','||MyView."Last_Name"||','||MyView."Sent_Date" "From MyView" Where "Document_ID"=$1;

' LANGUAGE 'SQL';

It worked fine...returning me multiple records of concatenated string,until there came a record where "Sent_Date" field was Null.It returned nothing then.

I want to put a check to set null values equal to zero(namely to set "sent_Date"=0 If it is Null) , but looks like SQL does not support "IF THEN ELSE".plz let me know how can i put that check in this function.?

Tahira Aslam

---------------------------------
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wei Wang 2002-05-30 12:03:26 Cannot build JDBC driver in 7.1.3.
Previous Message Curt Sampson 2002-05-30 11:12:57 Non-linear Performance