Re: How to pickup null values in SQL Language?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Tahira Aslam <tahira_aslam(at)yahoo(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to pickup null values in SQL Language?
Date: 2002-05-31 06:30:06
Message-ID: 20020530232625.B51562-100000@megazone23.bigpanda.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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).

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tahira Aslam 2002-05-31 06:47:50 Re: How to pickup null values in SQL Language?
Previous Message Tahira Aslam 2002-05-31 06:18:38 Re: How to pickup null values in SQL Language?