Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: JDBC Driver setObject() converts empty string to NULL

Re: JDBC Driver setObject() converts empty string to NULL

From: Thomas Kellerer <BDHLDUUTPRWS_at_spammotel.com>
Date: Wed, 31 May 2006 10:30:05 +0200
Message-ID: <4e52gdF1cmpubU1@individual.net>

On 31.05.2006 10:08 Robert Klemme wrote:

> Vladimir M. Zakharychev wrote:

>> Hmm... Not exactly clear what the problem is, but I'll try:
>> in Oracle, empty strings *are* NULLs. This is known and
>> documented behavior. setString() or setObject() probably
>> convert empty strings to NULLs because they are the
>> same thing in Oracle. You need to code for this behavior
>> as it can't be turned off.
> 
> Thanks for the hint.  I can't believe that this slipped by me until now. 
>  For interested parties, here is a simple test:
> 

This is very well documented:

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/sql_elements5a.htm#59112

Interesting enough they claim "this may not continue to be true in future releases". But this has been true since Oracle 7 up to 10 and I don't really believe this will be changed ;)

Thomas Received on Wed May 31 2006 - 03:30:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US