impossible to update rows specifying columns with NULL value? - Mailing list pgsql-jdbc

From Guillaume Cottenceau
Subject impossible to update rows specifying columns with NULL value?
Date
Msg-id 87wtssj2c4.fsf@meuh.mnc.ch
Whole thread Raw
Responses Re: impossible to update rows specifying columns with NULL  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
Hi,

I have a table with a column of type `integer'. I insert data in
this column with NULL value. The NULLs should be OK in the
database since when I perform a SELECT on this row, after a
getInt on this column (value obtained is 0), ResultSet#wasNull is
true.

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, and I set the value
with "ResultSet#setNull( 4, java.sql.Types.NUMERIC )", but when
executing the statement, no change occurs (0 rows affected).

I am using postgres 7.4.5 with postgresql-8.0-310.jdbc3.jar.

Any idea?

Thank you.

--
Guillaume Cottenceau

pgsql-jdbc by date:

Previous
From: Markus Schaber
Date:
Subject: Abandoning PGobject
Next
From: Oliver Jowett
Date:
Subject: Re: impossible to update rows specifying columns with NULL