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

From Stephan Szabo
Subject Re: How to pickup null values in SQL Language?
Date
Msg-id 20020530232625.B51562-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: How to pickup null values in SQL Language?  (Tahira Aslam <tahira_aslam@yahoo.com>)
Responses Re: How to pickup null values in SQL Language?
List pgsql-general
On Thu, 30 May 2002, Tahira Aslam wrote:

>
>  thanks Mr.Stephen your solution solved my problem. But now I want to
> use COALASCE function in a function which uses 'plpgsql'
> language.(function needs to perform same functionality as it was in
> SQL language)

> 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).

Hmm, on current sources similar structures with coalesce seem to work as
long as the cast is done.

Can you give enough of the schema to recreate the specifics of your
situation (table structure, view structure and the function).


pgsql-general by date:

Previous
From: Tahira Aslam
Date:
Subject: Re: How to pickup null values in SQL Language?
Next
From: Tahira Aslam
Date:
Subject: Re: How to pickup null values in SQL Language?