pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
testing for null value in integer field?
5+ messages / 4 participants
[nested] [flat]

* testing for null value in integer field?
@ 2003-12-19 16:07  Geoffrey <esoteric@3times25.net>
  0 siblings, 3 replies; 5+ messages in thread

From: Geoffrey @ 2003-12-19 16:07 UTC (permalink / raw)
  To: pgsql-sql

How does one check for an unset value in an integer field?

I've tried such things as:

select ..... where intnumber = ''
select ...... where intnumber =  ?
select .....  where intnumber = NULL

Thanks.

-- 
Until later, Geoffrey	esoteric@3times25.net

Building secure systems inspite of Microsoft




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: testing for null value in integer field?
@ 2003-12-19 16:08  CoL <col@mportal.hu>
  parent: Geoffrey <esoteric@3times25.net>
  2 siblings, 0 replies; 5+ messages in thread

From: CoL @ 2003-12-19 16:08 UTC (permalink / raw)
  To: pgsql-sql

try: column is null, as manual shows.

Geoffrey wrote:

> How does one check for an unset value in an integer field?
> 
> I've tried such things as:
> 
> select ..... where intnumber = ''
> select ...... where intnumber =  ?
> select .....  where intnumber = NULL
> 
> Thanks.


C.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: testing for null value in integer field?
@ 2003-12-19 16:12  Wei Weng <wweng@kencast.com>
  parent: Geoffrey <esoteric@3times25.net>
  2 siblings, 1 reply; 5+ messages in thread

From: Wei Weng @ 2003-12-19 16:12 UTC (permalink / raw)
  To: Geoffrey <esoteric@3times25.net>; +Cc: pgsql-sql

Geoffrey wrote:

> How does one check for an unset value in an integer field?
>
> I've tried such things as:
>
> select ..... where intnumber = ''
> select ...... where intnumber =  ?
> select .....  where intnumber = NULL
>
> Thanks.
>
It is actually WHERE intnumber IS NULL. You don't use operator = to 
compare with NULLs, you use IS.

HTH.

Wei




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: testing for null value in integer field?
@ 2003-12-19 16:16  Guy Fraser <guy@incentre.net>
  parent: Geoffrey <esoteric@3times25.net>
  2 siblings, 0 replies; 5+ messages in thread

From: Guy Fraser @ 2003-12-19 16:16 UTC (permalink / raw)
  To: pgsql-sql

select .....  where intnumber IS NULL

Geoffrey wrote:

> How does one check for an unset value in an integer field?
>
> I've tried such things as:
>
> select ..... where intnumber = ''
> select ...... where intnumber =  ?
> select .....  where intnumber = NULL
>
> Thanks.
>




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: testing for null value in integer field?
@ 2003-12-19 16:22  Geoffrey <esoteric@3times25.net>
  parent: Wei Weng <wweng@kencast.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Geoffrey @ 2003-12-19 16:22 UTC (permalink / raw)
  To: pgsql-sql

Wei Weng wrote:
> Geoffrey wrote:
> 
>> How does one check for an unset value in an integer field?
>>
>> I've tried such things as:
>>
>> select ..... where intnumber = ''
>> select ...... where intnumber =  ?
>> select .....  where intnumber = NULL
>>
>> Thanks.
>>
> It is actually WHERE intnumber IS NULL. You don't use operator = to 
> compare with NULLs, you use IS.

Thank you muchly....

-- 
Until later, Geoffrey	esoteric@3times25.net

Building secure systems inspite of Microsoft




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-12-19 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-12-19 16:07 testing for null value in integer field? Geoffrey <esoteric@3times25.net>
2003-12-19 16:08 ` CoL <col@mportal.hu>
2003-12-19 16:12 ` Wei Weng <wweng@kencast.com>
2003-12-19 16:22   ` Geoffrey <esoteric@3times25.net>
2003-12-19 16:16 ` Guy Fraser <guy@incentre.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox