Re: Query Which is not supposted to list NULLS is listing

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: shreedhar <shreedhar(at)lucidindia(dot)net>
Cc: Postgre General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query Which is not supposted to list NULLS is listing
Date: 2003-05-27 08:59:54
Message-ID: 3ED3290A.7080905@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

shreedhar wrote:
> Hello,
>
> I am attaching an output with this mail. I am sure that I am not
inserting
> '' for jobcomments in any case.

A simple check would be:

SELECT jobcomment from tblJobIncharge where id=51 AND jobcomment IS NOT
NULL;

If you get back a row then jobcomment is not null and probably has the
empty string in it ...

To make sure that jobcomment is not '' you can try this query:

SELECT jassignedid, ascii(JobComments) FROM tblJobIncharge WHERE
JobComments IS NOT NULL AND projectid >= 50 AND projectid <= 100

If jobcomment is '' then you will get '0' in the job comment field, if
it is really null then you will get '' (i.e. nothing).

So if you get a 0 it means that you have job comment fields with the
empty string '' in them, they are not null ...

HTH,

Jean-Christian Imbeault

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2003-05-27 09:31:16 Re: Query Which is not supposted to list NULLS is listing
Previous Message shreedhar 2003-05-27 08:43:55 Re: Query Which is not supposted to list NULLS is listing