impossible to update rows specifying columns with NULL value?

From: Guillaume Cottenceau <gc(at)mnc(dot)ch>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: impossible to update rows specifying columns with NULL value?
Date: 2005-02-28 12:28:27
Message-ID: 87wtssj2c4.fsf@meuh.mnc.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Markus Schaber 2005-02-28 14:10:11 Abandoning PGobject
Previous Message Markus Schaber 2005-02-25 21:03:00 Re: Statement level transactions