pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Cottenceau <gc@mnc.ch>
To: pgsql-jdbc@postgresql.org
Subject: impossible to update rows specifying columns with NULL value?
Date: 28 Feb 2005 13:28:27 +0100
Message-ID: <87wtssj2c4.fsf@meuh.mnc.ch> (raw)

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



view thread (11+ messages)  latest in thread

Message-ID: <87wtssj2c4.fsf@meuh.mnc.ch>
Permalink:  ../87wtssj2c4.fsf@meuh.mnc.ch/
Also on:    postgresql.org/message-id/87wtssj2c4.fsf@meuh.mnc.ch

 · 

reply

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
  Subject: Re: impossible to update rows specifying columns with NULL value?
  In-Reply-To: <87wtssj2c4.fsf@meuh.mnc.ch>
  References: <87wtssj2c4.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