From: Guillaume Cottenceau <gc@mnc.ch>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: impossible to update rows specifying columns with NULL value?
Date: 01 Mar 2005 10:05:22 +0100
Message-ID: <87fyzfzqgd.fsf@meuh.mnc.ch> (raw)
In-Reply-To: <42237EFA.1060502@opencloud.com>
References: <87wtssj2c4.fsf@meuh.mnc.ch>
<42237EFA.1060502@opencloud.com>
Oliver Jowett <oliver 'at' opencloud.com> writes:
> Guillaume Cottenceau wrote:
>
> > The problem is when trying to UPDATE (changing values of other
> > columns): my PreparedStatement uses "... WHERE column = ?" to
> > specify the NULL value for the said column,
>
> You can't do that and get the results you expect. "column = NULL" is
> never true (because "NULL = NULL" is false). You should use IS NULL to
> match a NULL value.
It's a pity. This would be very helpful. With such situation, we
can't use the same prepared-statement to match NULL and non-NULL
values then, or I missed something?
--
Guillaume Cottenceau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: gc@mnc.ch, oliver@opencloud.com
Subject: Re: impossible to update rows specifying columns with NULL value?
In-Reply-To: <87fyzfzqgd.fsf@meuh.mnc.ch>
References: <87wtssj2c4.fsf@meuh.mnc.ch> <42237EFA.1060502@opencloud.com> <87fyzfzqgd.fsf@meuh.mnc.ch>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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