Re: How to pickup null values in SQL Language? - Mailing list pgsql-general

From Tahira Aslam
Subject Re: How to pickup null values in SQL Language?
Date
Msg-id 20020531064750.27917.qmail@web11003.mail.yahoo.com
Whole thread Raw
In response to Re: How to pickup null values in SQL Language?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general

 
> Select cast(MyView."Document_ID" as
> Text)||','||cast(MyView."First_Name" as
> Text)||','||cast(MyView."Last_Name" as
> Text)||','||Coalesce(cast(MyView."Sent_Date" as Text),'NONE') From "MyView"
> Where "Document_ID"=$1;
> Language 'plpgsql';
>
> But it gives error "Bad date external representation 'NONE' "....

Well, the above isn't legal plpgsql really (you'd need to be using
two quotes around NONE and there's a missing begin/end, I assume
you're just not showing those).


:)  Actually i didn't feel the need to write whole function. This function worked fine until there came a record with one empty field, and it returned me nothing.I feel the need to replace the Null fields with 'NONE' value...so that concatenated string should return me record. (It returns nothing if there is a field with no value inside it ..I mean empty field.)

 



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

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: How to pickup null values in SQL Language?
Next
From: Curt Sampson
Date:
Subject: Re: Scaling with memory & disk planning (was Re: Non-linear