Re: impossible to update rows specifying columns with NULL

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: impossible to update rows specifying columns with NULL
Дата
Msg-id 42237EFA.1060502@opencloud.com
обсуждение исходный текст
Ответ на impossible to update rows specifying columns with NULL value?  (Guillaume Cottenceau <gc@mnc.ch>)
Ответы Re: impossible to update rows specifying columns with NULL value?  (Guillaume Cottenceau <gc@mnc.ch>)
Список pgsql-jdbc
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.

See http://www.postgresql.org/docs/8.0/static/functions-comparison.html
for details.

-O

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Guillaume Cottenceau
Дата:
Сообщение: impossible to update rows specifying columns with NULL value?
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Abandoning PGobject